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 an Ubuntu Unity desktop with a cloud-init configuration, on a Raspberry Pi.

Ubuntu Unity

A blast from the past! This was one I didn’t manage to test last time, but I’ve a major soft spot for good ol’ Unity, having spent many years with it as my desktop on the PC back in the pre-Bionic days. So let’s give it a spin on the Pi!

For those unfamiliar with Unity, it has some quite different ideas of its own: the start menu and quick launcher are on the left of the screen (rather than the traditional top or bottom). If I recall correctly (and I’m sure someone will correct me in the comments if I’m not) this was because most screens have a wide-screen aspect ratio, so if you’re going to “waste” space with non-application stuff, better to do it horizontally than vertically (which sounds pretty reasonable to me).

In later iterations, and indeed in Unity 7 that we’re using here, it also borrows a few tid-bits from MacOS X: the window icons (minimize, maximize, close) are on the top left, and application menus appear in the bar at the top of the window rather than within the application window. Again, I think I’m right in stating this was (at least partially) in aid of not wasting vertical real-estate.

A screenshot of the Ubuntu Unity desktop. The quick-launch icons are on the left of the screen below the Ubuntu icon at the top left. At the very top is the grey bar which switches to the application menu when hovered. It also contains the system tray icons at the top right. Within the desktop can be seen Firefox, behind a file-browser, Rhythmbox, VLC playing an old episode of "Spaced", and htop running in a terminal window.

The selection of bundled applications was excellent. VLC for video playing, and Rhythmbox for music. Couldn’t ask for better. The file browser is the excellent Nemo from the Cinnamon desktop. Everything was generally reliable and worked … eventually.

Unfortunately, this brings us to the first major issue: performance. As with all the alternative desktops so far there’s no Wayland support yet, but even discounting that performance was painfully slow. I did note that, as under Budgie, cups-browsed was eating 100% of a CPU core again. But even after killing that, things still felt very sluggish, especially after the snappy responses of Lubuntu and Xubuntu.

Integration was also spotty. The menus for most things appeared in the top bar. But not Firefox (arguably the most important application on the desktop). One might argue that Firefox doesn’t have a menu bar any-more, that it’s succumbed to the modern obsession with hiding everything behind a “burger” button but the menus are still there: hit Alt+F and you’ll see (in fact several of the menus aren’t available from the “burger” button, which is probably why).

However, the screen-saver? Works! This is the only other flavour to, out of the box, reliably suspend my monitor and lock the desktop with no crashes (Lubuntu being the other).

Verdict

I’d really love to recommend Unity. Its interface ideas may be novel and quite different to most other flavours, but they make a good deal of sense (far more than GNOME’s do, to me anyway). However, while the reliability is great, the performance just isn’t good enough for use on a small platform.

The theme (whether light or dark) made it rather hard to distinguish window edges of inactive applications. Looking at the screenshot above, can you see where the file-browser ends, and the music player or the browser begins? There are also some strange edges to menu corners as if the environment wanted to draw shadows there, but forgot:

A close up screen-grab of an open menu under Ubuntu Unity. The menu itself appears in a shade of grey almost indistinguishable from the white of the web-page beneath it. However, the bottom left and right corners of the menu are shaded distinctly darker, as if intended to blend with some shadow rendered around the whole menu, but which is not present.

This all gave me an impression that things were not rendering “as intended”. Is there meant to be a shadow border around windows?

Configuration

For Ubuntu Unity, 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: unity-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  - ubuntu-unity-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