Wednesday, 26 March 2025

Modern Ubuntu web kiosk using chromium as the browser engine

 I have been working to prepare a digital atlas exhibit for the Natillik Heritage Centre in Gjoa Haven, Nunavut, Canada. Working with Indigenous communities and various communities of practice to help them build digital atlases is something we have been doing at the Geomatics and Cartographic Research Centre for more than a couple of decades now.

 There is more and more interest in local ownership and stewardship over these data systems and I have deployed atlas and knowledgebank systems in a handful of locations before, sometimes just with a passive status display (for example, a TV showing the live location and updates provided by Inuit hunters) and other times with a large format touchscreen allowing for interaction with the atlas and the various multi-media within.

 The technology has changed over the years so each project starts with a fresh review of what's possible and what's best given the needs. For a previous project I chose to use a Windows 7 client running proprietary SiteKiosk software to drive the browser via a 3M Touch Display. The server ran SmartOS (clever USB key boot with all disks in a ZFS mirrored-pair pool for everything else) with a Linux VM in a zone. The server was a Dell PowerEdge tower and was bigger, noisier, and hotter than ideal. The client was its own small form factor PC. Both were tucked under a diorama near the screen but this was not ideal.

 Fast forward to today and the small, fanless, big storage, and low wattage (but still powerful) computer situation is much better and Proxmox PVE is my hypervisor of choice. For this latest build I had hoped to get away with a single Proxmox system running the atlas server VM (Ubuntu) as well as handling the client duties somehow. Sadly, the OnLogic Karbon 700 SE system had some teething problems and was just not playing well with the Dell C6522QT touch display being used this time around. Fortunately, the display is designed to fit an optional OptiPlex Micro 7020 which would still leave us with two systems but at least it would be contained within the screen chassis.

 Wanting to go with a minimal Linux solution for the client this time, I started looking for kiosk options on Linux. The current best effort being made for this type of thing appeared to be Ubuntu Core running Ubuntu Frame with a browser kiosk snap. But the OptiPlex came with Windows 11 pre-installed and I had installed Ubuntu 24.04.01 Desktop alongside in a dual-boot configuration. I did not want to wipe the factory Windows 11 until I knew I wouldn't need to revert to it for the kiosk. My attempt to overwrite the Ubuntu Desktop partition with a pre-built Ubuntu Core image was flawed before it began and required some work to get to a better spot with Ubuntu Server instead.

 After experimenting with Ubuntu Frame and wpe-webkit-mir-kiosk on Ubuntu Server rather than Ubuntu Core, I was able to get the kiosk pieces working but the wpe-webkit-mir-kiosk browser engine didn't play well with the atlas system it had to serve. The map tiles were being shuffled and the UI events seemed to be having problems. We only really support and test atlas stuff with Firefox and Chrome so I did some more research and then asked for some more help. The solution came quickly from one of the authors of Ubuntu Frame who pointed out that the chromium snap might do the trick and it did.

 Steps:

Install Ubuntu Server 24.04.02 and then:
```
sudo snap install ubuntu-frame
sudo snap set ubuntu-frame daemon=true
sudo snap install chromium
sudo snap set chromium url=https://clyderiveratlas.ca
sudo snap set chromium daemon=true
snap connect chromium:wayland
```
To change the URL:
```
sudo snap set chromium url=https://discourse.ubuntu.com/t/current-guide-for-a-firefox-based-kiosk-using-ubuntu-frame/57638
sudo snap restart chromium
```
 I am happy to report that the configuration persists and the ubuntu-frame and chromium snaps come up again after a reboot. The system is set to automatically boot after a loss of power so I think this part of the puzzle is more or less solved.

Thursday, 20 March 2025

Set up dual boot with Grub2 after messing things up

Working on a project recently, I made the mistake of thinking that a pre-built Ubuntu Core image could be written over an existing Ubuntu Desktop ext4 partition to switch the OS. Well first of all, Ubuntu Core pre-built images are for entire disks and include their own partitions including a bootloader that can self-heal the OS partition. So yeah... after doing this the grub2 bootloader I had installed on an EFI partition do longer found any OS to boot since it's `/boot/grub/grub.cfg` file was gone.

Following the suggestion in the post linked above, I created an Ubuntu Server USB Key installer and installed that on the partition I'd designated for Ubuntu. I had to specify manual layout instead of whole disk and choose the partition to be `/` but other than that, it was a normal Ubuntu server install. Sadly though, unlike when I installed Ubuntu Desktop the first time through, it did not notice the Windows 11 partition or offer to set up dual boot.

After some RTFM I found a bit about how the update-grub command by default runs os-prober to find and add other operating systems to the grub config at boot time. Simply running update-grub in my Ubuntu Server environment seemed to do the trick and Windows Boot Manager was found and added as a non-default option in the Grub2 boot menu. I rebooted, tried choosing Windows and it worked. Then again and back into Ubuntu Server by default. All is well.

Thursday, 13 March 2025

Dell Touchscreen Display USB Touch Interface not recognized

 I was having some issues setting up a touchscreen kiosk in Ubuntu 24.04 using a Dell 65 4K Interactive Touch Monitor - C6522QT paired with a Dell OptiPlex Micro 7020 installed in the built-in OptiPlex holder tray in the display.

 First I discovered that the instructions have you connect via HDMI 1 and USB 1 ports on the display. Unfortunately, the onboard Intel UHD Graphics 770 won't do 4K over HDMI. The monitor will scale for you but the resolution is lower. The touchscreen input was working in Windows and Linux.

 To get to the full 3840 x 2160 resolution, you need to connect using DisplayPort.

 After switching to DisplayPort and feeling quite chuffed with myself, I had to set the project aside for a few weeks. When I came back to it again, I did some Ubuntu updates, tinkered with trying to get some form of remote desktop working, and then happened to try using the touchscreen again. To my horror, it didn't respond at all. Research led me to learn that the Dell monitor uses an InGlass Display made by a company called FlatFrog that is supported by the hid-multitouch driver that has been in the mainline Linux kernel since version 3.5.

I'll skip the parts where I spend hours messing with my Ubuntu system and pick up where I start to try to enable the hid-multitouch driver and look for the device.

root# modprobe hid-multitouch
root# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 8087:0033 Intel Corp. AX211 Bluetooth
Bus 001 Device 005: ID 413c:2514 Dell Computer Corp. Dell Universal Receiver
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

This is when I discover that the device isn't showing at all. I don't know what I'm looking for, but what's there is other stuff. Unplugging everything leaves me with:

root# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 8087:0033 Intel Corp. AX211 Bluetooth
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

So I am now wondering why the USB touch device isn't showing up at all.

So I started flailing around some more switching ports on the computer, etc. and eventually wondered if there might be something that I've changed on the monitor. So I then had the brilliant idea to RTFM.

Lo and behold, on page 12 of the Dell C6522QT User's Guide is the magic "Input sources and USB Pairing" section. From this in inferred that because I had switched my display connection from HDMI 1 to DP, I needed to move the USB connection to from USB 1 to USB 3.

Boom:

root# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 8087:0033 Intel Corp. AX211 Bluetooth
Bus 001 Device 009: ID 0424:2916 Microchip Technology, Inc. (formerly SMSC) USB2916 Smart Hub
Bus 001 Device 010: ID 25b5:00e6 FlatFrog FlatFrog DA-TK65P-20P2WE-M4-00e6
Bus 001 Device 011: ID 0424:284c Microchip Technology, Inc. (formerly SMSC) Hub Feature Controller

Bus 001 Device 012: ID 413c:2514 Dell Computer Corp. Dell Universal Receiver
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 0424:5916 Microchip Technology, Inc. (formerly SMSC) USB5916 Smart Hub

And the touchscreen started working. Woo!

Wednesday, 12 March 2025

Set search domain when VPN connected using Network Manager in Ubuntu 24.04



I recently assembled a Framework Laptop 13 and installed Ubuntu Desktop 24.04 on it. I have been working through numerous little things to make life easier for myself. One I found a solution to recently was setting a specific DNS resolver search domain when connected to a VPN.


nmcli c modify <vpn-settings-name> ipv4.dns-search '<domain>'


You should specify <vpn-settings-name> that corresponds to a VPN setting name in GUI. And <domain> is the domain name you want to search via DNS in the remote network.

Modern Ubuntu web kiosk using chromium as the browser engine

 I have been working to prepare a digital atlas exhibit for the Natillik Heritage Centre in Gjoa Haven, Nunavut, Canada. Working with Indig...