Raspberry Pi 4 Ubuntu Server 18.04.3 Installation Guide

Ubuntu Server logo
Ubuntu Server logo

Ubuntu Server has been my favorite Linux distribution for years. On everything but the Raspberry Pi I run Ubuntu Server but felt stuck with Raspbian on the Pi. Until now! Ubuntu Server 18.04.2 has been released and major improvements have been made to the official Pi branch.

The Raspberry Pi 4 is not officially supported out of the box yet on the current Ubuntu Server Raspberry Pi images but you can get it working by manually updating the firmware. Solid state storage is also working but with the catch of having to use a micro SD card as a bootloader since the Pi 4 does not have official boot support yet. I describe how to do both in this article.

The Raspberry Pi’s peripherals such as WiFi / Bluetooth are now fully supported. Previous Ubuntu Server versions for Raspberry Pi (like many other distros) had broken or completely missing drivers for core components such as WiFi / Bluetooth. In the 18.04.2 update the firmware for the WiFi and other components is now included out of the box making it a fully functional distribution!

This is the first distribution besides Raspbian that feels like you can just image it and everything works. I’ll guide you through the process in this guide. It only takes a few minutes to set up.

Update 9/3/19 – New Precompiled Test Image Available (v5)

These are the manual instructions to get things working. If you are looking for a precompiled Ubuntu image check out my post here: https://jamesachambers.com/raspberry-pi-4-ubuntu-server-desktop-18-04-3-image-unofficial/

I have compiled my own unofficial kernel and created a preinstalled release that overcomes all previous RAM limitations. That’s right, the image let’s you use all 4 GB of memory if you have the 4 GB model. WiFi tweak is also included and should be working properly.

This image is in prerelease/testing so I have no idea which parts of it still need tweaks added. It is absolutely not properly tested and will probably burn your house to the ground as well so don’t use it in any type of production environment!

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

Recommended Gear

I highly recommend upgrading to a solid state setup. The performance gains are gigantic. It’s now less than 30 bucks to take your Pi solid state. This is the best performance upgrade you can possibly get for a Pi.

With the new Raspberry Pi 4 it’s even more beneficial to use USB storage since a USB 3.0 bus was finally added in the Pi 4 letting it take full advantage of solid state drives. This is the setup I am currently using:

Raspberry Pi 4 Model B 2 GB

Raspberry Pi 4 Ubuntu Server 18.04.3 Installation Guide

StarTech 2.5″ SATA to USB 3.0 Adapter -AND- Kingston A400 SSD 120GB SATA 3 2.5” Solid State Drive

Raspberry Pi 4 Ubuntu Server 18.04.3 Installation Guide
Raspberry Pi 4 Ubuntu Server 18.04.3 Installation Guide

Or for a compact setup: SanDisk Extreme Pro 128 GB USB Solid State Flash Drive

Raspberry Pi 4 Ubuntu Server 18.04.3 Installation Guide

For a micro SD card setup: SanDisk Extreme A2 Application Class Micro SD Card

Raspberry Pi 4 Ubuntu Server 18.04.3 Installation Guide

These storage choices are ones that all scored highly on the end-user submitted Raspberry Pi Storage Benchmarks and will give you outstanding I/O performance on the Raspberry Pi. I also personally own all of them and recommend them knowing they are compatible and perform well on the Pi.

Getting Ubuntu Server

64 bit (aarch64)

I have a custom compiled prebuilt 64 bit image available for testing. This version supports addressing all 4 GB of RAM if available. The WiFi fix for bootflags3 is also already implemented into the precompiled version. Get my custom built kernel from the Ubuntu-Server-raspi4-unofficial GitHub page.

32 bit (armhf)

To get the 32 bit version head to the official Ubuntu Raspberry Pi page at https://wiki.ubuntu.com/ARM/RaspberryPi and scroll to the “Official Images” section. Until the official Raspberry Pi 4 image is released choose the Raspberry Pi 3B+ armhf release and follow the directions in the next sections to update the firmware for a Pi 4 boot.

Writing the Base Image

This part is easy. Extract the image from xz format to img format (7zip is great and free and can extract these). Now write the img to your media (Micro SD card, solid state drive, USB storage, etc). the same way you would for any other distribution!

Updating Firmware for Raspberry Pi 4

If you are using the CloudKernel 64 bit image you can skip to the “Boot Ubuntu Server” section as it already implements the updated firmware. If you are using the 32 bit image or the official Ubuntu Server preinstalled server image from Ubuntu’s web site you will need to update the firmware using these instructions.

Remove Existing Firmware

The firmware in the current release was not built with Raspberry Pi 4 support so we need to update the firmware on the /boot/ partition for the Pi 4 to be able to boot correctly.

Insert/mount the micro SD card in your computer and navigate to the “boot” partition. Delete everything in the existing folder so it is completely empty.

Download Latest Firmware

32 bit Firmware Instructions

If you are trying to run the 64 bit version of Ubuntu skip to the 64 bit instruction section next. For 32 bit versions of Ubuntu download the firmware from the official GitHib repository here: https://github.com/raspberrypi/firmware/archive/master.zip

The latest firmware is everything inside master.zip “boot” folder (including subfolders). We want to extract everything from “boot” (including subfolders) to our micro SD’s “boot” partition that we just emptied in the previous step. Don’t forget to get the “overlays” folder as that contains overlays necessary to boot correctly.

The end result will look something like this on the “boot” drive:

$ ls
  COPYING.linux                bcm2711-rpi-4-b.dtb   kernel.img
  LICENCE.broadcom             bootcode.bin          kernel7.img
 'System Volume Information'   cmdline.txt           kernel7l.img
  bcm2708-rpi-b-plus.dtb       config.txt            overlays
  bcm2708-rpi-b.dtb            fixup.dat             start.elf
  bcm2708-rpi-cm.dtb           fixup4.dat            start4.elf
  bcm2708-rpi-zero-w.dtb       fixup4cd.dat          start4cd.elf
  bcm2708-rpi-zero.dtb         fixup4db.dat          start4db.elf
  bcm2709-rpi-2-b.dtb          fixup4x.dat           start4x.elf
  bcm2710-rpi-3-b-plus.dtb     fixup_cd.dat          start_cd.elf
  bcm2710-rpi-3-b.dtb          fixup_db.dat          start_db.elf
  bcm2710-rpi-cm3.dtb          fixup_x.dat           start_x.elf

64 bit Firmware Instructions

To boot Ubuntu Server in 64 bit mode we need to download the 64 bit version of the firmware. The .dtb files are different between 32 bit and 64 bit operating systems. Raspbian does not come with a 64 bit bootloader and one isn’t provided in the official GitHub repo either.

I have these 64 bit versions available in my Ubuntu Server precompiled image.

Create/Update config.txt and cmdline.txt

Navigate to the micro SD /boot/ partition. Create a blank cmdline.txt file with the following line:

dwc_otg.fiq_fix_enable=2 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rootflags=noload net.ifnames=0

Next we are going to create config.txt with the following content:

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]

[all]

64 bit config.txt Configuration

To boot the Pi in 64 bit mode we need to add the following lines to the config.txt:

arm_64bit=1
enable_gic=1
armstub=armstub8-gic.bin 

The final configuration for 64 bit will look like this:

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

[pi4]

arm_64bit=1
enable_gic=1
armstub=armstub8-gic.bin

[all]

These enable all the different 64 bit related options you need to perform a 64 bit boot on the Pi.

Boot Ubuntu Server

We are now ready to boot the device. Insert the micro SD card and power on the device.

Note: The very first startup can be very slow. Be patient. It can take up to a couple minutes with no activity lights then all the sudden everything will start blinking and SSH will open up.

Fix apt-get update / Prevent Further Updates

If you try to apt-get update now it will try to update your firmware with older firmware from the Ubuntu repository. The workaround for now is to remove that package so it keeps your existing firmware. Make a note to remember you did this step as later on we will want to reenable updates from the repository once support has been added.

sudo apt-mark hold flash-kernel

You may now run sudo apt-get update && sudo apt-get upgrade. I would avoid using dist-upgrade yet because the kernels in the repository it will update you to don’t support the Pi 4 yet. But this should get you all up to date on the packages!

Once the firmware in the apt repositories has been updated for the Pi 4 it will be safe to reinstall initramfs-tools and let it update through the normal process again.

Solid State Drive (SSD) Configuration (Optional)

USB booting has not been added into the Raspberry Pi 4 firmware yet but is being worked on right now. In the mean time you can use your micro SD card as a bootloader and still boot the whole operating system (rootfs) from the solid state drive giving you the full USB 3.0 speed increases system wide. Once the Pi USB booting is officially released you should be able to boot directly from the device without any makeshift bootloader SD card necessary.

First create a fully imaged and booting micro SD card following the earlier steps in the tutorial. After you have created the micro SD installation you should now image your SSD / USB drive with the same Ubuntu image you used to create the SD card.

Now navigate to the “boot” partition on the newly created SSD / USB drive and remove everything in there just like we did with the SD card earlier. Now copy the “boot” folder from the micro SD card to the solid state drive. This is necessary because even though the files in “boot” are read off our micro SD card initially some firmware files in the later load stages are read off the mounted drive and if the necessary firmware files are missing the system won’t boot.

Now that you’ve created the SSD / USB drive partitions and copied the “boot” partition from the SD card to your new drive we need to update your SD card’s cmdline.txt to point to the SSD / USB drive’s partition.

dwc_otg.fiq_fix_enable=2 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait rootflags=noload net.ifnames=0

The key part we need to change here is the “root=/dev/mmcblk0p2” section. mmcblk0p2 is a hardware identifier for micro SD storage. We need to change this to the device your storage is detected as.

If you are using a USB to solid state drive adapter it’s very likely your drive will be addressed as /dev/sda2. Therefore we will change the root=/dev/mmcblk0p2 to root=/dev/sda2

root=/dev/sda2

The final line will be:

dwc_otg.fiq_fix_enable=2 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 rootwait rootflags=noload net.ifnames=0

Plug both the micro SD and the solid state drive into the Pi and boot it up.

Remember: the first boot can take 2-3 minutes for first startup so give it some time before assuming it didn’t work.

Wireless Fix

The current non-free Raspberry Pi firmware had the wrong bootflags3 for quite a while for the Raspberry Pi 4 and these firmware files are definitely out there. Here is a one liner I wrote to replace the Raspberry Pi 3 boot flags in this driver with the Raspberry Pi 4 one:

sudo sed -i "s:0x48200100:0x44200100:g" /lib/firmware/brcm/brcmfmac43455-sdio.txt

Restart the system afterward.

Configuration

Default User / Password

The username and password for your initial login to Ubuntu Server will be:

user: ubuntu
password: ubuntu

You will be required to change your password after logging in for the first time. Make sure on the prompt you enter the current “ubuntu” password before typing in your new password or the device will kick you out completely and you’ll have to log in again.

Set Time Zone

To configure the correct time zone for Ubuntu Server use the following command:

sudo dpkg-reconfigure tzdata

This will take you to a very easy to follow menu to select your correct time zone and applies it to the system.

Update System

For best stability, security and performance you should immediately update your system and packages to the latest version. This will also grab all of the latest fixes/improvements making your Raspberry Pi Ubuntu experience much better.

This part is easy. Type:

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

Change Default GPU Memory Split

The default amount of memory allocated to the GPU on the Raspberry Pi is around 76 MB of our 1 GB. In 2 GB and 4 GB models the amount gained from this is negligible but is still worth it for the 1 GB model.

If you type the command “free” you will see that your Raspberry Pi is missing this memory under the “total” column. We can reclaim most of this memory back by setting the GPU memory split to 16 MB. If you are planning on installing a GUI in the future you should not make this change.

This option is set in the config.txt file. It’s exactly the same file as Raspbian uses but it is located at /boot/firmware/config.txt instead of /boot/config.txt. Open config.txt with the following command:

sudo nano /boot/firmware/config.txt

We will add the following line at the bottom of config.txt:

gpu_mem=16

Press Ctrl + X and type yes to save the file. Now restart the Pi by typing

sudo reboot

After the reboot finishes type “free” again and you will see that your total available memory has increased and can now be used by the system and your applications!

Benchmark Storage (Optional)

It’s very important to have a well performing storage device on the Raspberry Pi. Storage has always been and continues to be one of the biggest performance bottlenecks for Raspberry Pis.

Until the Raspberry Pi 4 we didn’t even have 3.0 transfer speeds. Now that we have them with Raspberry Pi 4 we are discovering there is a very large difference between not only manufacturers and models, and in the case of SD cards the manufactured date / batch produced! This means that if you bought a FakeName Extreme 3.0 in 2015 you could buy the exact same line and brand of SD card one year later and you would get something with a totally different grade of flash memory and microcontroller that would perform much better/worse.

Because no one person could possibly buy all this hardware and benchmark it on their own I created a script to benchmark your storage and anonymously submit it via a basic web form here.

The best thing would be for you to run the script but if you don’t want to run it yourself check out the existing recommendations for high performance storage ideas to get the most out of Ubuntu Server on the Pi.

Conclusion

I’m very excited to see my favorite Linux distributions continue to evolve to the point where they are comparable in performance and stability to Raspbian. I’ve been testing extensively on Ubuntu Server 32 bit and 64 bit for my Raspberry Pi Minecraft Server project and not only is it on par with Raspbian but starting to do things so well it sometimes makes Raspbian feel a little dated.

If you have any questions or suggestions don’t hesitate to leave me a comment on the post or use my contact form to message me privately! I’m good about responding quickly and my articles are constantly revised to address questions or do something a better way that a reader pointed out.

Have fun!

174 thoughts on “Raspberry Pi 4 Ubuntu Server 18.04.3 Installation Guide”

  1. Avatar for Jeff

    Is it correct to assume that the above does not work if you are trying to start with the ubuntu images linked in this forum post:
    https://www.raspberrypi.org/forums/viewtopic.php?f=131&t=258532

    The first post in this thread links to some new images from Canonical with fixes for the various issues with Ubuntu 19.10 on the Pi4.

    I was able to get them working, and I was trying to follow your instructions to get this configured to boot from the SSD. The part that I run into that differs from your instructions is that there is no cmdline.txt – but btcmd.txt appears to be similar. However, the line in there that you show does NOT say root=/dev/mmcbkl0p2 — instead it says root=LABEL=writable. I tried changing this line to root=/dev/sda2 but this doesn’t work. It all boots up with the SSD connected, but it seems that the pi is still booting off the SDcard.

    Any suggestions?

    Thanks!

    1. Avatar for jamesachambers

      Hey Jeff,

      I believe the different behavior is because the official image is using uboot instead of initramfs-style booting. Instead of mounting by root=PARTUUID=d34db33f (like Raspbian) or root=/dev/device it is looking for a partition with the label of “writable”.

      I think the easiest thing to try would be do to a Raspbian style PARTUUID mount (follow my guide here as if you were on Raspbian to get the PARTUUIDs and make sure they are different, etc). Basically you would change the btcmd.txt (make sure that’s the one it’s using in config.txt) line from root=LABEL=writable to root=PARTUUID=d34db33f-02.

      I think I was also able to get this working by using either fdisk or gdisk’s advanced options menu to change the partition labels and changing the SD card’s label from writable to something else. However, this is not as simple as it sounds, because there are differences between MBR and GPT partitions and labels and there are tons of pitfalls to watch out for. If you want to try changing the partition labels yourself do it with a test image you set up that you don’t mind breaking until you’re sure you’re doing it correctly!

      If none of this works still, /dev/mmcblk0p2 might be compiled (hard coded) into the uboot configuration. If you have changed the partition labels correctly and it still keeps booting from the SD card then this is likely true in the newest image you linked to. In order to change this you need to change the config file and then rebuild the uboot image. This isn’t as bad as I’m making it sound but it’s not an easy or fast process either. Instructions on how uboot for Raspberry Pi works (a little outdated, definitely not for the image you’re talking about but it should be similar enough to stumble through) are available here if you want to give reconfiguring uboot a shot!

      1. Avatar for Jeff

        Awesome – I will give this a shot (probably start with the UUID method, since I had done that with Raspbian previously and I think I understand the process. Is it necessary to edit the fstab file too? I am thinking that may be where the labels of writable and system-boot are coming from.

      2. Avatar for Jeff

        Well – I got it to work. It turns out that i needed to edit the nobtcmd.txt file (and not the btcmd.txt file – but I left that one modified too).

        I just used the root=/dev/sda2 line instead of the PARTUUID, as the latter option didn’t seem to work.

        The one odd thing I notice is that if I run findmnt, it appears to show that /boot/firmware is coming from /dev/sda1, when I expect that it should be coming from /dev/mmcblk0p1 if i understand all this correctly. In order to get this to work, i had to mount /dev/mmcblk0p1 temporarily to edit the SDcard’s nobtcmd.txt file.

        Do i need to modify the /etc/fstab file to make apt update work correctly (like we have to do on raspbian)? That file doesn’t show any PARTUUID’s like it did in Raspbian. Just labels.

        1. Avatar for jamesachambers

          Hey Jeff,

          That’s fantastic, good find! That’s the same way I do my image but in the new Ubuntu version they have cmdline.txt broken up into the bt and nonbt versions.

          The only thing you want to check is to make sure the micro SD card is mounted for partition 1 (boot) so that any firmware updates that come down from apt actually get used when you boot your device. If the updates are going to the SSD’s boot partition they won’t be utilized in the boot process so any fixes/enhancements that come down won’t get used on your device!

  2. Pingback: ROS Melodic on Raspberry Pi 4 (Dec 2019) – Well Now We Know

  3. Avatar for STR4NG3R

    If you were a youtube video, I would like and subscribe. If you were a tweet, I would re that shit. Thank you for all your hard work and dedication, sir. *Salutes*

  4. Avatar for elovalvo

    Dear sir,
    in the login screen I try with user ubuntu and password ubuntu, but not work (say login incorrect).
    Can you help me?

    1. Avatar for fjp

      I am interested in this too. I have a grove oled display connected and got the following error using sudo i2cdetect -y 1:

      Error: Could not open file `/dev/i2c/1′ or `/dev/i2c/1′: No such file or directory

      I used `sudo raspi-config` tool to enable i2c and after a reboot the previous `i2cdetect` command works but I am still not able to connect the oled display.

  5. Avatar for Hans Roh

    Awesome!

    I have Pi4 4gb model and installed 64bit version for in 5 minutes.

    Now I am testing as home server which is connected to WIFI and running never stoped Python network daemon. It is working perfectly for last 32 hours with average system load 1.6. CPU heat is somewhat high than I expected but I will keep testing about a couple of weeks.

    Many thnaks for your good job.

  6. Avatar for dl

    Many thanks for sharing this “unofficial” version.

    I installed MATE as a desktop but can only start it with the startx command.
    I imagine it has to do with proper installation of GRUB, but I wasn’t able to achieve a good result. I spent hours trying to find a procedure that would work, but without success. Do you have any suggestion ?

    Being able to use Ubuntu on the Raspi 4 is a pleasure — and a big step for me as I intend to upgrade part of the 80+ Raspi 3B I currently use in a not-for-profit educational project.

  7. Avatar for codinglunatic

    Thanks so much, James! Although, I’d like to look into overclocking settings next ^_____^

    I have my own Raspbian “fork-on-install” script, it includes i.e. a fix to the audio crackling that is present by default even in Raspbian Buster’s pre-builds. I wonder why nobody gets this fixed, since the fix is as simple as this:

    sudo pico /etc/pulse/default.pa

    ## look for:

    load-module module-udev-detect

    ## to the end of that line, add: tsched=0
    ## like this:

    load-module module-udev-detect tsched=0

    ## save & exit

    ### This simple modification fixed all the sound crackling and static on my PC, in Google Chrome, chromium, HTML5 videos, etc etc

    Thanks to whomever pointed that fix out on the Internet. Also, a recommended plug-in for Firefox and Chromium is “264ify” which comes pre-installed in Raspbian – from its options “disable 60fps video”. Add to that uBlock Origin, tweak its settings so that you’ll get rid of all the extra junk whenever possible, and just that means a lot less stuff to worry about, get annoyed by or clogging up your system whenever browsing through them internets.

    Keep up the good work. Even in this test stage, the Ubuntu Server fork seems to deliver much more than Raspbian, which is sadly kind of staggering onwards.

    1. Avatar for jamesachambers

      Hey codinglunatic,

      Amazing, I’m sure you just spent me many hours of time tracking down this fix! I’ll get it integrated for v13.

  8. Avatar for ERodrigo

    Thanks a lot for the detailed info… but I miss a critical step: after writing the base image you get a SD card with a single file, ubuntu-….-img. Next steps (removing firmware and loading a new one) require accessing the /boot partition. How do you access any partition inside the img file? I guess there are some intermediate tasks required to unfold the img into a file system, and these tasks cannot be executed in the PI4.

    1. Avatar for jamesachambers

      Hey ERodrigo,

      The boot partition is the FAT32 partition. All you need to do is plug your media into your computer to access it at any time! It does not require being inside the 4 for any of these steps.

  9. Avatar for Eric Cottrell

    Thanks for your continued work! It took some searching and experimentation to get Bluetooth configured. I am leaving this comment and listening to a stream over a Bluetooth speaker using my RPi4B 4GB.

    I noticed there was a BCM-0bb4-0305.hcd file in the /lib/firmware/brcm directory, which does not seem to be the right firmware. I got BCM4345C0.hcd and placed it in the directory. I decided to use the raspbian pi-bluetooth package as the model. I had to change the references from /dev/serial1 to /dev/ttyAMA0 in the btuart script. I had to change the references from dev-serial1.device to dev-ttyAMA0.device in the pi-bluetooth.service file.

    This may not be the Ubuntu way of doing things, but it works for now.

    1. Avatar for jamesachambers

      Hey Eric,

      Fantastic find! I know a couple of others commented they were having issues with the bluetooth as well. I will hook mine up and reproduce what you’ve done and implement it into the image!

  10. Avatar for Michael

    > “Note on total_mem=1024: at the moment the Raspberry Pi 4’s SD card won’t work in 64 bit mode without capping the total memory to 1 GB. This is being worked on and will be fixed as soon as official support rolls out.”

    Seriously? This will be a show-stopper for me since I’ve got the 4GB Pi 4B and the additional RAM and gpu_mem is what I need this to do for me (it’s a Kivy app with heavy graphics).

    1. Avatar for jamesachambers

      No, not seriously actually. I forgot to remove that from the guide. The image has no such limitation anymore.

      I have updated the guide and removed that rogue line, sorry about that!

  11. Avatar for Daniel Frieling

    (please replace my previous comment)
    OMG!!! YOU ARE THE BEST 🙂 – I tried your procedures a few weeks ago but ran into so many problems, couldn’t get alsa-utils to work, our own configuration software (for configuring a headless pi when you don’t know the IP) … just got everything running just beautifully, I do believe. Now I can get on with the rest of my software development w/o the limitations of the 3b+ just not powerful enough for the stuff I’m looking to release shortly (pi4 with pihole, vpn, router features – easy to use for home users).
    Dan
    Here is a list of installs/commands I ran with no issues at all:

    curl -sSL https://install.pi-hole.net | bash
    sudo apt-get install alsa-utils
    sudo apt-get install ccrypt
    sudo apt-get install ntfs-3g
    sudo apt-get install ntp
    sudo apt-get install ntpdate
    sudo apt-get install sox
    sudo apt-get install wireless-tools
    sudo dpkg-reconfigure tzdata
    sudo modprobe snd_bcm2835
    timedatectl set-timezone US/Eastern
    amixer cset numid=1 100%

  12. Avatar for Magnus

    Just installed your test image (v8). Couple of notes/questions:

    1. Would have been nice to include the ‘wireless-tools’ package. I had to go *ALL* the way upstairs to plug it into ethernet 🙁
    2. I’m curious how the booting sequence works; in every other rpi os I’ve used, the `cmdline.txt` file is in the /boot dir, but you have it in the `/boot/firmware` dir. How does the firmaware (or otherwise) know to look in there?
    3. I tried installing [userland](https://github.com/raspberrypi/userland), but got the error “VCHI initialization failed” when trying to run `/opt/vc/bin/vcgencmd`. Let me know if you’re up for solving this and manage to do so! This is as far as google took me:

    “`
    $ sudo apt-get install build-essential
    $ git clone https://github.com/raspberrypi/userland.git && cd userland
    $ ./buildme –aarch64
    $ sudo user mod -aG video,www-data ubuntu # Followed by reboot
    $ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/vc/lib
    $ export LD_LIBRARY_PATH
    $ /opt/vc/bin/vcgencmd version
    VCHI initialization failed.
    “`

    Many Thanks
    Magnus

  13. Avatar for Radomir

    Is it possible to connect to serial TTY out of the box in this version?
    Since I want to use it as a server and I don’t have wired LAN available, I need to setup wifi first.

  14. Avatar for OlafCScholz

    Hi James,

    Thank you for providing the new UBUNTU version for the Pi 4. With your immage it was pretty easy to install it.

    Unfortunately it was not possible to install xubuntu-desktop afterwards – is this a known problem?

    Thank you in advance
    OCS

  15. Avatar for Anastasius

    Hi James

    I’d like to try out your ubuntu-server install, but I’m worried that the official/supported version will come out soon and I’ll want to switch to that. I’m not very experienced with installing and/or switching between linux distros. Am I correct in saying that one would not be able to easily switch/upgrade to the official ubuntu version having installed what you’ve put together here?

    Thanks
    Anastasi

    1. Avatar for jamesachambers

      Hey Anastatius,

      We don’t really know when (or technically if) official support will come for the Pi 4. The Ubuntu team has announced that Ubuntu Mate will come to the Pi 4 but I’m not sure if they’ve stated that it will come for mainline Ubuntu Server / Desktop 18.04.3 but I assume that it will be ported eventually.

      The good news is that this image is the official version with a custom kernel and kernel updates are on hold using sudo apt-mark hold. Once Ubuntu releases a kernel that is compatible with the Pi 4 the following command will drop my kernel and switch to the Ubuntu one:

      sudo apt-mark unhold flash-kernel linux-raspi2 linux-image-raspi2 linux-headers-raspi2 linux-firmware-raspi2

      Now if you run this command right now the image will try to update itself to the official Ubuntu kernel and will break since they haven’t released official Pi 4 support but once it is released that command will switch you completely back to the Ubuntu kernel.

      To build the custom image I actually use the official Ubuntu image and just add some modifications. If you want to see exactly how it works check out https://github.com/TheRemote/Ubuntu-Server-raspi4-unofficial/blob/master/BuildPiKernel64bit.sh which is the exact script I build this image with.

      xzcat ubuntu-18.04.3-preinstalled-server-arm64+raspi3.img.xz > ubuntu-18.04.3-preinstalled-server-arm64+raspi4.img
      MountXZ=$(sudo kpartx -av ubuntu-18.04.3-preinstalled-server-arm64+raspi4.img)

      The script takes the official Ubuntu image and mounts it and then makes the modifications and copies a custom kernel built with Pi 4 support (you can also do this yourself by downloading the latest image and running the above linked script). Any changes I made are super easily undone to go completely official!

  16. Avatar for Tom A

    I’m wanting to add kernel modules and need the aarch headers to do so, Any tips on where to find and install them?

    Thanks,
    Tom

Leave a Comment

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

Type here..