It's Pi all the way down...

by

See Also: The intro post which links to all the other flavour posts. Skip down here for the configurations used.

In this post, we’ll be looking at creating a Lubuntu desktop with a cloud-init configuration, on a Raspberry Pi.

Lubuntu

Lubuntu is a lightweight flavour of Ubuntu, based on LXQt (which is the desktop environment that RaspiOS is based upon too). It’s certainly the lightest in terms of resource usage from all the desktops I’m comparing, and one of the most responsive too.

A screenshot of the Lubuntu desktop. A small panel sits at the bottom of the screen showing (from left to right) the small applications menu button (adorned with a bird), the numbers 1 through 4 for the desktop switcher, some quick-launch icons for the file-manager and firefox, the window switcher, and the small icons in the system tray, followed by the clock. Above are numerous overlapping windows including a PDF showing a section of the FreeRTOS manual datasheet, "htop" running in a terminal, "Sintel" playing in VLC, a file browser, and Firefox showing the Lubuntu homepage.

It’s a bit prettier than when I last saw it 3 years ago, but still doesn’t have the polish of the “full” desktop suites like GNOME or KDE. The interface feels very responsive but it’s notable that there’s no Wayland support yet so the performance of graphically heavy things is not entirely smooth.

One issue immediately jumped out, which was the incorrect selection of the default audio output (the 3.5mm jack output which wasn’t connected, instead of HDMI). This is a known issue (LP: #1993347), and one that occurs on almost every other flavour too. Thankfully it’s a trivial work-around (just pick the HDMI output instead) and the selection persists across reboots, so it’s a one-time fix.

The applications on Lubuntu are understandably minimal, but surprisingly good! Most desktop environments try and bundle “native” applications for specific purposes, like a video player. By “native” I mean applications that stick strictly within that desktop’s base toolkit (whether that’s GTK or Qt, and their corresponding media bits), so that the distribution of that desktop doesn’t bloat itself out with additional libraries (or whole frameworks) for a single application. This means you’ll see things like the Parole or Totem video players … right before you open a command line, sudo apt install vlc, and never look back.

Lubuntu, by contrast, just installs VLC saving you a whole step! That said, VLC is all you get for media playback here and, capable though VLC is with music, it’s not set up as an album browser. I’m too used to having something to do just that. The distro seed giveth, and the distro seed … leaveth stuff out.

There were a couple of minor oddities. The two partitions on the SD card show up as “removable” (which they fairly obviously … aren’t) on the system tray widget. After one system upgrade and a reboot, the wallpaper disappeared inexplicably. However, the screen-saver worked perfectly. Locked the screen and put the monitor in power-saving mode. Why do I mention this? Firstly, I’ve had a long-standing issue with the official GNOME desktop not putting my monitor into power-saving mode (LP: #1998716). Secondly … screen-saver breakage became a bit of a theme the further I went on with this series …

Otherwise, things mostly worked well. The included file browser is PCManFM, which is capable (and fast!). It’ll also be familiar to users of RaspiOS as it’s the default file browser there too. No issues opening things, including over unmounted network shares, no problems printing or scanning over the network, and Firefox worked as normal.

Verdict

It’s not the prettiest, but it is lightweight, responsive, and has a nice choice of default apps. In practice it feels functional enough that I’d be happy to use it as my desktop, but I’d definitely miss the ability to easily “tile” applications (maybe there’s a shortcut for this that I didn’t find!).

Configuration

For Lubuntu, the configurations I used were as follows. For the boot configuration, highlighted lines are those changed from the lunar defaults:

config.txt

 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:

cmdline.txt

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:

user-data

 1#cloud-config
 2
 3hostname: lubuntu-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  - lubuntu-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:

network-config

1network:
2  version: 2
3  ethernets:
4    eth0:
5      dhcp4: true
6      optional: true