1. Change the bootloader
Both the armhf and arm64 images use u-boot as the bootloader, which can be hard to configure if it doesn't fit your display and it also blocks the Pi 3's built in WiFi. Because of this, I still recommend using the Raspberry Pi's built-in bootloader. This will allow you to swap a microSD card across a Pi 2 and a Pi 3 (armhf only), configure the config.txt and cmdline.txt to fit your display, and access the Pi 3's built-in WiFi.
Flash the image to a microSD card, but before you insert it into the Pi, remove the kernel entry from config.txt, and then reconfigure it so that the Pi's bootloader directly boots the kernel and initrd. Here's an entry for this:
Code: Select all
kernel=vmlinuz
initramfs initrd.img followkernel
2. Enabling USB booting
The Ubuntu Server images now come with recent copies of the bootloader files (bootcode.bin, *.elf, *.dat) meaning that USB booting is now possible, but unfortunately not out of the box. The cmdline.txt points the kernel to /dev/mmcblk0p2 as the root partition, meaning the kernel will fail to boot Ubuntu if you attempt to boot from USB. Fortunately, this can be fixed with a simple change to the cmdline.txt.
For the original Pi 3B, you need to program USB booting first if you want to boot from USB. This is not needed on the Pi 3B+ or 3A+ since USB booting is enabled by default on these models.
Flash the image to USB storage but before you insert it into the Pi, replace the root entry with the following:
Code: Select all
root=LABEL=writable
3. Enabling hardware accelerated graphics
You can use the experimental VC4 driver with the linux-raspi2 kernel. Simply add the following entry to config.txt to enable it:
Code: Select all
dtoverlay=vc4-kms-v3d
4. Desktop environment
This is a minimal Ubuntu Server image which does not come with a desktop environment preinstalled. However, one can be installed with one of the following commands:
Code: Select all
sudo apt install xubuntu-desktop # For Xubuntu's desktop
sudo apt install ubuntu-budgie-desktop # For Ubuntu Budgie's desktop
sudo apt install kubuntu-desktop # For Kubuntu's desktop
sudo apt install xfce4 # For vanilla XFCE
sudo apt install lxde # For vanilla LXDE
sudo apt install kde-plasma-desktop # For vanilla KDE Plasma
If you plan on using resource-hungry web browsers and other resource-hungry software, I recommend creating a swapfile. Do so with the following commands:
Code: Select all
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
Code: Select all
/swapfile swap swap defaults 0 0
Code: Select all
sudo swapon --show
cloud-init can slow down boot time, so you should get rid of it unless you actually plan on actually using the image as a server. Run the following commands to remove it:
Code: Select all
sudo rm -rf /etc/cloud/
sudo apt purge cloud-init
If you want to install a 64-bit kernel and therefore be able to run 64-bit software on the armhf image, simply run the following commands:
Code: Select all
sudo dpkg --add-architecture arm64
sudo apt update
sudo apt remove linux-raspi2
sudo apt install linux-raspi2:arm64
Code: Select all
arm_64-bit=1
Code: Select all
sudo apt install firefox:arm64
Is Ubuntu Server worth it on the Raspberry Pi? Yes. You get up-to-date software such as Firefox which is several versions behind in Raspbian. You also get a 64-bit Linux distro (if you chose the arm64 image) which is based on Debian like Raspbian, giving Raspbian users a distribution which is the same in many ways (same package manager, etc). I recommend you at least give it a try and post about your experience with it.
Credit to everyone who contributed to the Raspberry Pi page on the Ubuntu Wiki. A lot of the information in this post was based on the information provided by the Ubuntu Wiki.