Run Ubuntu Desktop on a Raspberry Pi 4

A Raspberry Pi 4 is a pretty competent computer for a student’s desktop. I have setup two of these for my kids and apart from a few proprietary packages, everything works well. However, Raspbian won’t cut it, mostly because its’ Firefox is way too old. Hence we’ll go install Ubuntu Desktop.

By the way: this article is merely a reminder for myself. I did not invent any of this, it was stolen from all over the Internet. But hey, it works. And maybe it helps you.

First a few words about the non working stuff, so you know what you will end up with. Microsoft Teams doesn’t have an ARM version of their Linux program. You’ll be able to use the web interface for Teams, but that doesn’t do video – at least for now. The same goes for Zoom: their web client won’t do video on RPi4. There are two ways around this: 1) install Teams and/or Zoom on your (kids’) mobile phone / tablet and use that; 2) use Jitsi – which does work on a regular Firefox on a Rpi 4.

Now for the installation, because that is probably why you came here.

You will need a Raspberry Pi 4 with 4GB of RAM with all the extras like a power supply, keyboard, mouse, monitor and a micro-SD-card, and an extra computer to write the micro-SD-card with. Maybe a case with a cooler, too, because this machine tends to get hot and it will lower its’ processing speed to cool down if there is no fan.

  1. Download the Rpi3/4 Ubuntu Linux server installation from http://cdimage.ubuntu.com/releases/19.10.1/release/ubuntu-19.10.1-preinstalled-server-arm64+raspi3.img.xz I honestly don’t know why this is a non-secured link, but it is.
  2. Follow the steps to “Flash Ubutu onto your microSD card“.
  3. Put the MicroSD in your Rpi4 and start it up.
  4. Log in as user ubuntu with password ubuntu and change the password afterwards, as requested
  5. Connect the Rpi4 to a network. Then start “top” and wait about 30 minutes. After having connected the network, your Rpi will start auto-updating and you’ll have to wait till it’s ready. If you know how to stop the update and start installing stuff, be my guest. Might save you some waiting time.
  6. Type sudo apt update
  7. Now we’ll start installing the real stuff:
sudo apt remove cloud-init{,ramfs-{copymods,dyn-netconf}}
sudo apt install ubuntu-desktop slick-greater
sudo cat >> /etc/lightdm/lightdm.conf <<EOF
[SeatDefaults]
greeter-session=slick-greeter
EOF
sudo snap remove lxd

That’s pretty much it. Reboot. Use your desktop!

While I am writing this in April, 2020, there is an Ubuntu beta version: Ubuntu 20.04. So from here, you could try to update your machine – and spoiler: it works. Plain and simple:

sudo do-release-upgrade -d

… where “d” stands for “development version”. Another route to 20.04 is to download the – currently still beta – release of the Raspberry Pi 20.04 installation disk, which can be found at http://cdimage.ubuntu.com/releases/20.04/beta/ubuntu-20.04-beta-preinstalled-server-arm64+raspi.img.xz – and that will probably change soon to http://cdimage.ubuntu.com/releases/20.04/release/ubuntu-20.04-preinstalled-server-arm64+raspi.img.xz (I’ll change the link, then). Not tested – yet – but I will, in a few days.

Now there were a few things I would like to add to my RPi4s, and I will document these here. First thing: remote access to the desktop.

sudo apt install vino
sudo cat >> /etc/xdg/autostart/vino.desktop <<EOF
[Desktop Entry]
Type=Application
Exec=/usr/lib/vino/vino-server
Hidden=false
NoDisplay=true
Name=vino
Comment=shared access desktop server
EOF

… or you could choose to only start Vino for a certain user, like the Ubuntu user:

cat >> ~ubuntu/.config/autostart/vino.desktop <<EOF
[Desktop Entry]
Type=Application
Exec=/usr/lib/vino/vino-server
Hidden=false
NoDisplay=true
Name=vino
Comment=shared access desktop server
EOF

Then don’t forget to add:

gsettings set org.gnome.Vino prompt-enabled false
# or better still
dbus-launch --exit-with-session gsettings set org.gnome.Vino prompt-enabled false

… for this user, to not see a prompt after trying to access the desktop.

You may want to auto-login user Ubuntu too, with

autologin-user=ubuntu

in your /etc/lightdm/lightdm.conf