Raspberry Pi 4 Ubuntu Server / Desktop 18.04.3 Image (unofficial)

Fine, I'll do it myself
No Official Pi 4 Support? Fine, I’ll do it myself!

This is a unofficial distribution of Ubuntu Server 18.04.3 for Raspberry Pi 4. It is provided with the purpose of letting us all play with the new Pi 4’s new increased RAM and other capabilities until Ubuntu’s repositories are updated with support for the newest Pi.

Once official support is released through the Ubuntu repositories this project will effectively cease to exist (until, dare I dream, the Pi 5?). The image supports KVM, has support for the Pi 4’s new 3D display driver, and can also be upgraded to a full desktop installation!

I want to also thank all the commenters on my Ubuntu Server Installation Guide for Raspberry Pi 4 who have contributed a ton of fixes to help get the image to the point it is at now! This has truly been a collaborative effort and I expect it will continue to be until official support is released.

Features

  • Custom compiled 64-bit kernel based on the rpi-4.19.y source tree
  • Preinstalled image contains Ubuntu Server 18.04.3 installation that can be upgraded to a full Ubuntu full desktop installation
  • Able to address all memory up to 4 GB of RAM
  • 3D driver support via vc4-fkms-v3d and upgraded Mesa version
  • KVM enabled
  • USB_UAS support enabled
  • Fixes for most drivers implemented

GitHub Project Location

The image and source code to build the image are open source and freely available on GitHub:

https://github.com/TheRemote/Ubuntu-Server-raspi4-unofficial/

Update Firmware First (using Raspbian)!

One important new thing to understand about the Raspberry Pi 4 vs. older Pis is that the 4 now has real onboard firmware that is on a special chip separate from everything else. Older Raspberry Pis did not have real onboard firmware and loaded all of their firmware from the SD card every single boot.

Since Ubuntu does not officially even support the Pi 4 yet the Ubuntu repositories do not have firmware compatible with the Pi 4.

Before you install this image you should run Raspbian and install the latest firmware using this command:

sudo apt-get update && sudo apt-get dist-upgrade -y
sudo rpi-update

Note that rpi-update will install bleeding edge firmware but since we are running a bleeding edge operating system and cannot receive updates I highly recommend putting the latest possible one you can on before installation.

If you have multiple SD cards or storage devices laying around it is a good idea to designate one of them as the “Official Raspbian Firmware Updater” card. Using this method you can periodically swap out the card and install the latest firmware updates to your Pi 4 and then switch right back to Ubuntu.

Preinstalled Image Download / Instructions

To download the precompiled image see the releases section located at https://github.com/TheRemote/Ubuntu-Server-raspi4-unofficial/releases

The file you are looking for on the releases page is ubuntu-18.04.3-preinstalled-server-arm64+raspi4.img.xz. Download this file and extract the .img file from inside. Use the free and awesome 7-zip if you are on Windows.

Now burn the .img file using your favorite program. I use Win32DiskImager. Now insert your SD card / storage device into the Pi and start it up!

Username: ubuntu

Password: ubuntu

Upon logging in for the first time you will be required to change the default password to something else. Once you have done that log back in and you should be all set!

Install Full Ubuntu Desktop Version

To install the full version of Ubuntu Desktop use one of the following:

  • sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get install xubuntu-desktop # or
  • sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get install kubuntu-desktop

The xubuntu variant is lighter than the kubuntu variant but either one will need to download and install thousands of packages to complete the upgrade. This can obviously take quite a long time. How long it will take depends on your internet connection and the quality of your storage device.

Running this task overnight or when you have an errand to go run is definitely advised!

Performance

Firmware & apt Updates

The kernel has been recompiled to enable the Pi 4 specific performance features (as well as features specific to Ubuntu that aren’t used in Raspbian) and the image performance is pretty good now. This will likely continue to improve further as people test the image and find fixes and new firmware patches coming out every few days to address lingering problems/performance issues.

As explained in the update firmware section above, Ubuntu will not update the Pi 4 firmware for you as it is not yet officially supported. Firmware fixes are coming out as often as every couple of days! Make sure you keep your firmware up to date using the methods I outline in the firmware section.

You may use apt-get update && apt-get upgrade and dist-upgrade normally in this image. The only thing it won’t update is the firmware to prevent breaking your installation. All other Ubuntu security patches/updates will appear and install normally just like the official distribution. It’s highly recommended to always keep up to date in apt!

As a reminder the commands are:

sudo apt-get update && sudo apt-get dist-upgrade

Storage

Beyond keeping your firmware and distribution up to date there is only one thing that sets apart one Ubuntu installation on a Pi from any other: your storage device. The difference between a low end to high end SD card can be a 2-3x performance, and the difference between a SD card and a solid state drive is a whole order of magnitude.

To help people know whether they have high performance storage I made the Raspberry Pi Storage Benchmark that will give you a performance score. Running the benchmark is really easy. Paste or type the following commands:

wget https://raw.githubusercontent.com/TheRemote/PiBenchmarks/master/Storage.sh
chmod +x Storage.sh
sudo ./Storage.sh

The storage benchmark will run several well known and respected benchmarks such as iozone and fio and calculate a score for your device.

Most importantly, to compare your score or if you want to just view other benchmark submissions check out the full results of all submissions in a searchable/sortable table at the Raspberry Pi Storage Benchmark Results Page.

Using USB Storage / Solid State Drive (SSD)

Right now the Pi 4 still lacks USB boot support. However, you can still do it by using the trick of having a SD card that you use as a bootloader only and have the rootfs on your USB storage. This is kind of a waste of a SD card but it’s definitely worth it as it allows you to hit those full sweet sweet USB 3.0 transfer speeds right now without waiting until the USB booting firmware update is released.

See my Raspberry Pi 4 USB Booting Guide for more information on how this works and how to set it up.

Known Issues / Fixes

This section will be updated with known issues/fixes as people test the image and give feedback.

Display driver issues (HDMI)

This change is included in v6 and later of the image. Check that your /boot/config.txt file has the following line commented out:

dtoverlay=vc4-fkms-v3d

to

#dtoverlay=vc4-fkms-v3d

Now reboot the system and the display driver should be functioning normally.

CUPS system module fails to load

This change is automatically integrated in v6 and later of the image but in case the config file got reset here are the instructions.

The default config file for CUPS tries to load a parallel printer driver (which the Pi does not have parallel ports). To fix this we need to edit the CUPS filter config file.

Release History

Pre-Release v6 – 9/7/2019

  • Updated kernel to rpi-4.19.71
  • Integrated all available updates from apt into the base image
  • Fixed display driver issue — if you are running v5 you can fix it by commenting out dtoverlay=vc4-fkms-v3d from /boot/config.txt
  • Enabled Ceph support in the kernel .config
  • Added build flags to kernel build line to build a more complete device tree (dtbo files)
  • Integrated all upstream updates since v5 from raspberrypi-linux and firmware-nonfree including a 3D driver fix for aarch64

Pre-Release v5 – 9/3/2019

  • Desktop support added
    • Expect lots of warnings in the logs. If you find solutions to them please leave a comment — many commits come from the comments!
    • Be advised — installing can take quite a while on a Pi — overnight or when you have something to do is a good time
  • Type one the following commands to install your preferred flavor of Ubuntu Desktop
    • sudo apt-get install xubuntu-desktop # or
    • sudo apt-get install kubuntu-desktop

Pre-Release v4 – 9/2/2019

  • Recompiled kernel to include support for Ubuntu features that are not present in Raspbian
  • Enabled USB UAS support
  • Fixed video driver by modifying config.txt and compiling with 3D support
  • System now boots clean and loads all modules (sudo systemd status)

Pre-Release v3 – 9/2/2019

  • Fixed IPv6 and a few other module load errors

Pre-Release v2 – 8/31/2019

  • Boot time reduced from 100s to around 30s
  • Messing with apt-mark or flash-kernel is no longer necessary and the fix has been built into the image
  • Fixed bluetooth firmware bug that was looking in /etc/firmware instead of /lib/firmware
  • Fixed entropy bug causing slow startup
  • Fixed mdadm.conf RAID warning
  • Module.symvars is now available in /boot/firmware/ if you need it to build kernel modules
    If you need the whole source tree check out the accompanying build script in the repository. It’s exactly the same as how the kernel and modules were built.
  • Various other fixes (special thanks to Joan at jamesachambers.com for contributing so many)
  • More at https://jamesachambers.com/raspberry-pi-ubuntu-server-18-04-2-installation-guide/

25 thoughts on “Raspberry Pi 4 Ubuntu Server / Desktop 18.04.3 Image (unofficial)”

  1. Avatar for Jinyoung

    Hi James,

    thanks for great work! I have successfully installed your v7 image to my Pi4 as well as Kstars and indi server/drivers. One thing does not work for me is 5Ghz wifi. They do not appear in available wifi list. When I installed raspberian, they appeared and I could make connection. Is this known issue?

    Thanks

  2. Avatar for Tony

    Hi James.
    Very impressed with this. I’ve been trying for days to get a 64 bit image to boot before I found this. Note I’m up and running.
    But, does anyone else have a lagging, distorted or delayed audio? I’m plugging into a TV with an HDMI cable. The same TV and cable work fine for the Raspbarian OS.

  3. Avatar for Paul Spruit

    personally i prefer the gnome desktop so i’ve installed that instead, its a bit more stable than the kubuntu and the kubuntu but both do work fine.
    i’ve installed gnome with this command for those who are interested:

    sudo apt-get install ubuntu-desktop

  4. Avatar for Arnaud Mondit

    Hello,

    Just a quick remark on kernel sources & headers, it seems that the files /lib/modules/4.19.71-v8+/source & build are symbolic links to /home/james/rpi-linux (and /home/james/rpi-linux/kernel-build respectively). Is that expected? Because I can’t seem to install wireguard as the dkms build expects the kernel headers to be present for the current kernel. I’m trying to add them manually but it could be good if your image already included them?

    Thanks

  5. Avatar for EmilFR

    Hi James,

    Great works and very happy to see the project is very active.

    Any suggestion which image I can use for production server?

    Thanks!

        1. Avatar for thomas

          nvm. I figured it out. Also I decided to go with kubuntu and then enabled gnome shell and make a lot of tweaks to match my laptop. I have the pi 4 4gb model and surprising its faster than I thought with full desktop mode. Eventually will move to full ssd for more performance though!!!

    1. Avatar for jamesachambers

      Select “n” to not replace with the one from the repository
      The cups one included has a fix that will prevent CUPS from trying to load parallel port drivers (the Pi does not have parallel ports of course)

  6. Avatar for Joan

    Hello there!

    I’m very happy and exited with these release, almost everything is working! I installed mate and working under xrdp is very smoth. The only thing I need to fix is the bluetooth and the tipicall “System problem error detect” while running xrdp with ubuntu.

    Thank you very much James!!!

  7. Avatar for Jürgen Schober

    Hey James,

    Great work! Thanks for your efforts. I am on v5 and it runs rock solid. I needed a 64bit linux to run a java app server which requires 64bit. I had it running on Manjaro before (which supports 64bit aarch) but seems to have stability issues. I typically run all my PI’s on some form of Xubuntu (Xfce) (and Centos 7 on a PI3 front end server) and this works perfectly and I prefer a debian based system over aarch. Thank you so much!

  8. Avatar for Peter J. Jansen

    Hi James,

    I tried your suggestion of editing the /boot/firmware/config.txt file, but that did not improve the xrdp sluggishness (which again, could be related to xrdp, and not display driver problems). I also found out that using my SDL Hercules without using xrdp or an HDMI screen was a lot more stable, but eventually it still became unresponsive whilst htop was still showing it running. So I will try your latest v6 image, but in order to try narrowing down my tests, I will at first not add any desktop stuff (xubuntu and xrdp etc.), and find out how that goes.

    Thanks,

    Peter

  9. Avatar for Tizian

    Hey James,
    first of all thanks for this guide.

    I did the steps you mentioned above exept the firmware update with raspi-config because I dont have much knowledge about Linux and Im quite insecure with bleedingedge firmware. Because I still want to be able to boot my Raspian setup safely and stable. However Im running the latest stable firmware.

    Now to my problem.
    I wanted the 64bit System because I have the 4GB Ram Pi and wanted to use 3G Ram for my Minecraft server. I first tried it on Raspian but the system capped me at about 2GB and when I tried to use -Xmx3072 f.e. the Java VM didnt even start. Error: “could not reserve enough space for object heap”

    So I now use your Ubuntu v5 image and JDK8 64bit (I need the old JDK because its a modpack-server which won’t launch on newer versions).
    Now there isnt an Error like the one above, but when I observe the RAM in htop, the total system RAM wont go above 2.2GB. Although I executed the Server jar with -Xmx3072 and didnt get an error from the java VM like I got it earlier in the 32bit environment.

    Im not a native speaker so please be gentle with my english. I try my best. 😀

    Thank in advance
    Tizian 🙂

  10. Avatar for Jim Starkey

    I installed 4GB model as per instructions. Boots OK in text mode, but when shifts to graphics mode monitor (Dell ST2421L, just HD) says “current input timing is not supported”. I can ssh into the system, so it’s definitely running. I did update the firmware with Rasperian. A 4K monitor just give gray fizz.

    1. Avatar for jamesachambers

      Hey Jim,

      I think the image is currently having problems with 4K resolutions (EmilFR said the same thing). Something that worked for her was commenting out the line: “dtoverlay=vc4-fkms-v3d” in /boot/config.txt

      This may be a good thing to try as a workaround until the image is updated for this!

    2. Avatar for cob bailey

      Hi James I just imaged the v6 but still can’t get a display working. Seems like I get a different result every time I try it. Before it would show the colors from the raspberry logo, the scroll text for about 3 seconds, then the display would go dead. I’m using a TV for a monitor but it’s not 4K, only hd 1020. I really need this to work as Debian doesn’t work with the sensor we are trying to connect. Any help would be appreciated. Thanks, cob

  11. Avatar for Christian

    I just installed Ubuntu 18.04.03 on a RPi 3B+, and I ran into a problem (so far unsolved) that I hope your installation does not have:

    The Ubuntu Server only activates eth0, but not wlan0. I managed to get as far that I can activate it from the command line with “nmcli d connect wlan0”, but I cannot get it automatically activated at boot – it always waits an eternity for its (unconnected) eth0 instead.

    So, please, offer a way to run it off wifi only!

  12. Avatar for Peter J. Jansen

    I successfully used your pre-release v5 image, added xubuntu and a bunch of other stuff, all leading up to a successful build of the SDL Hercules mainframe emulator on a RPI 4 with 4GB. The resulting Hercules can successfully IPL some mainframe operating systems. The speed shows great improvements over my last successful similar tests on a RPI 2 of a few years ago. I’ve seen Hercules reporting mainframe emulated MIPS rates of up to 76 MIPS.

    But there are problems, probably not unexpectedly so, perhaps because of the pre-release nature of this RPI 4 Ubuntu, or of my not 100 % correct building of the SDL Hercules on the RPI 4 platform. I’ll need to investigate if had the right GCC options of the RPI 4 processor architecture. The problems manifest themselves in the Hercules emulator becoming slower and slower, as shown on an SSH connected “htop” screen. Eventually the RPI 4 freezes up completely, only power cycling restarts the RPI 4.

    My standard RPI 4 usage is headless, via “xrdp” from a Windows 10 system. I will also try it via a regular HDMI 0 screen and USB keyboard and mouse.

    Nevertheless, I thank you James for your efforts in trying to bring Ubuntu 18.04 64 bit to the RPI 4. Great work.

    Cheers,

    Peter

    1. Avatar for jamesachambers

      Hey Peter,

      Thanks for trying it! I do have some more improvements to the image coming (such as a compiler flag that generates more DTBOs) that may help as well. Definitely keep us posted!

      1. Avatar for Peter J. Jansen

        Hi James,

        Thanks for your reply.

        I have a bit more info which perhaps may be helpful to you.

        First of the good news. I was able to circumvent my stability problems by (1) ensuring to not use xrdp (which seems a huge consumer of CP cycles), and, (2) limiting the SDL Hercules emulator mainframe memory MAINSIZE to 2.5 GB. I’m going to keep this running for days on end to see how stable it is. The “htop” screen (in a SSH session) shows “Mem … 3.09G/3.72G”.

        On the negative side, when I use Ubuntu 18.04.3 on the RPI 4 via xrdp, even without this Hercules thing, then the response is very sluggish. E.g. moving a (xfce) window on the screen is verrry slow. This could be normal if xrdp needs more CPU resources than the RPI 4 has to offer. Or their might still some display driver problems in the RPI 4 Ubuntu ? Don’t know.

        Anyway, SDL Hercules, which is what I’m mostly toying with, does not really needs a screen. It is a pure server thing (emulating a mainframe), so this is really already now working super good for me.

        Cheers,

        Peter

        1. Avatar for jamesachambers

          Hey Peter,

          I’m about to release v6 shortly that fixes some display driver issues. If you want to try the fix on your v5 you have installed already do a sudo nano /boot/config.txt and comment out the line dtoverlay=vc4-fkms-v3d underneath the
          Pi 4 section. Or you can try the v6 image and let me know if performance is improved!

Leave a Comment

Your email address will not be published. Required fields are marked *

Type here..