In this post, we’ll be looking at creating a Kubuntu desktop with a cloud-init configuration, on a Raspberry Pi.
Kubuntu is the KDE-based spin of Ubuntu. For those unfamiliar, KDE is the other “big” desktop player besides GNOME, and is based on the Qt toolkit. KDE’s always had a more “traditional” feel in its desktop (almost staid, some might say). The start bar (with a classical categorised start menu) goes at the bottom, followed by the application switcher, and system tray. Applications all have a reasonably common look and feel, and all applications have every configuration option you could ever hope for scattered throughout their numerous pages of preferences.
This is in fairly stark contrast to GNOME which, of late, has been more experimental and has pursued a deliberate path of “making it simple”. To put it another way, if you sat your elderly mother in front of a modern GNOME system, it might take them a while to figure out how to get going. But on KDE, they’d be up and running right out the gate .
The last time I tried Kubuntu on a Pi, it was laughably slow, and I was expecting no different this time. I could not have been more wrong …
Kubuntu is notably the only other desktop environment here that supports Wayland out of the box. It defaults to X11, but you can easily select “Desktop Session: Plasma (Wayland)” from the bottom of the KDM login page, and this selection will persist for future logins. Speaking of logins, there’s a bizarrely long delay before the desktop shows up after login. This appears peculiar to KDE but if you put up with it, the wait is worthwhile!
When running under Wayland, the environment is buttery-smooth. All the little animations from the fade-in of the desktop, to the opening slide of the start menu proceed without jitters or jerks. Don’t expect any speed up in opening large applications. This is still a Pi, and I’m running these experiments off SD cards which top out at 20Mb/s transfer on a Pi 4. Nonetheless, I was astonished to find that the desktop I expected to be the heavy-weight laggard was up there with the best of them in responsiveness!
The bundled applications largely work well. The file browser is the capable Dolphin which was happy browsing and opening things from unmounted network shares, and has a nifty “multiple-selection” feature (look for the “plus” when hovering over items). One oddity is that, as under Lubuntu, it considered the partitions on the SD card “removable” (though it mercifully didn’t offer an eject button for the root partition). One other thing it notably managed was to extract files from an archive with drag’n’drop. This has been broken on GNOME (and thus Ubuntu, LP: #1923033) for years now.
As before, the default audio output is incorrectly selected, but again that’s a trivial work-around. Video playback is handled by the Haruna media player. Unfortunately this wasn’t happy playing things from unmounted network shares (despite them being accessible from the Open File menu). Otherwise, it proved one of the more capable bundled players, handling chapter markers and subtitles with aplomb. The bundled music player is Elisa which is a simple, attractive, and intuitive affair, but sadly doesn’t support playing (or indexing) anything other than a mounted file-system.
Firefox worked well, but now we finally come to something I alluded to at the start. When installed as a snap it doesn’t seem able to use the “full” Wayland mode (reverting to XWayland protocol instead). This is the reason for installing the deb, and also the reason for me re-writing a whole pile of stuff here !
The screen-saver works … then sometimes crashes. At this point I was getting rather used to flakiness in screen-savers but what surprised me was that, having crashed, it brought up a nice and detailed set of instructions on securely unlocking the desktop from another terminal. This … seems like an improvement?
What a difference from last time!
Great performance (after a slow initial login), combined with KDE’s legendary configurability. Some reliability issues still (screen-saver, not-so-removable storage!), but this is a genuinely useful desktop on a Pi now.
There’s also a ton of nice little UI tweaks that made it genuinely pleasant to use for several days. The start menu encapsulates all styles (categorical, one big list, and searchable), the system tray has myriad capabilities that make it far more useful than most (e.g. selecting the audio output, or bluetooth devices straight from the tray widgets without launching other things).
For Kubuntu, the configurations I used were as follows. For the boot configuration, highlighted lines are those changed from the lunar defaults:
1[all] 2kernel=vmlinuz 3cmdline=cmdline.txt 4initramfs initrd.img followkernel 5 6[pi4] 7max_framebuffers=2 8arm_boost=1 9 10[all] 11# Enable the audio output, I2C and SPI interfaces on the GPIO header. As these 12# parameters related to the base device-tree they must appear *before* any 13# other dtoverlay= specification 14dtparam=audio=on 15dtparam=i2c_arm=on 16dtparam=spi=on 17 18# Comment out the following line if the edges of the desktop appear outside 19# the edges of your display 20disable_overscan=1 21 22# If you have issues with audio, you may try uncommenting the following line 23# which forces the HDMI output into HDMI mode instead of DVI (which doesn't 24# support audio output) 25#hdmi_drive=2 26 27# Enable the serial pins 28#enable_uart=1 29 30# Autoload overlays for any recognized cameras or displays that are attached 31# to the CSI/DSI ports. Please note this is for libcamera support, *not* for 32# the legacy camera stack 33camera_auto_detect=1 34display_auto_detect=1 35 36# Config settings specific to arm64 37arm_64bit=1 38dtoverlay=dwc2 39 40[cm4] 41# Enable the USB2 outputs on the IO board (assuming your CM4 is plugged into 42# such a board) 43dtoverlay=dwc2,dr_mode=host 44 45[all] 46dtoverlay=vc4-kms-v3d
For the kernel command line, the entire file must consist of a single line of text so I would suggest simply copying this wholesale:
1zswap.enabled=1 zswap.zpool=z3fold zswap.compressor=zstd dwc_otg.lpm_enable=0 console=tty1 root=LABEL=writable rootfstype=ext4 rootwait fixrtc quiet splash
For the cloud-init configuration, the highlighted lines are those that you may wish to change after copying the content:
1#cloud-config 2 3hostname: kubuntu-pi 4 5locale: en_GB.UTF-8 6timezone: Europe/London 7 8keyboard: 9 model: pc105 10 layout: gb 11 12user: 13 name: "dave" 14 lock_passwd: false 15 gecos: "Dave Jones" 16 plain_text_passwd: raspberry 17 sudo: "ALL=(ALL:ALL) ALL" 18 19ssh_import_id: 20 - lp:waveform 21 22apt: 23 sources: 24 mozillateam: 25 source: 'ppa:mozillateam/ppa' 26 27write_files: 28 - path: /etc/apt/preferences.d/firefox 29 content: | 30 Package: firefox* 31 Pin: release o=LP-PPA-mozillateam 32 Pin-Priority: 501 33 34 Package: firefox* 35 Pin: release o=Ubuntu 36 Pin-Priority: -1 37 - path: /home/dave/.profile 38 append: true 39 defer: true 40 content: | 41 export MOZ_ENABLE_WAYLAND=1 42 43package_update: true 44package_upgrade: true 45package_reboot_if_required: true 46 47packages: 48 - kubuntu-desktop 49 - ubuntu-raspi-settings-desktop 50 - firefox
Finally, the networking configuration. I used Ethernet for my experiments, and given the number of packages that need installing I’d generally recommend that too. Please see the intro post for important information on adjusting the network configuration to Network Manager post installation:
1network: 2 version: 2 3 ethernets: 4 eth0: 5 dhcp4: true 6 optional: true
|||I leave it for the reader to judge what this implies about GNOME’s drive for simplicity …|
|||I’d started off this series doing everything “by the book” with Firefox from a snap, then after discovering that only the deb-based install supported this, wound up re-doing everything partly to ensure all the flavours had the best performance I could give them (full Wayland support if available without too much hacking), and secondly that they were on a level playing field (all snaps or all debs for Firefox).|