Headless RPI4 + Initial Install


I currently run a headless RPI4 in a custom enclosure (the RPI4 isn't easily removable) that doesn't have access to the HDMI display ports. Generally, to install an OS for the RPI4, I've always made an empty ssh file in the /boot directory of the SD card after extracting the new install (this works for the Ubuntu Server images as well). However, this doesn't work with the ubuntu-mate-20.04.1-beta2-desktop-arm64+raspi.img since the SSH server is not installed by default. This would be easy to do with APT after the initial provisioning as the notes indicate, however, I'm stuck without access to the HDMI display outputs.

My main question, is there a way enable SSH or some other form of remote management of the Ubuntu-Mate OS that I can configure or enable prior to deployment?

Also, in an effort to try something besides SSH, I connected to the RPI4 UART serial console PINs via an FTDI USB adapter & PUTTY, but I'm not able to login since a login prompt never appears (it remains at Started WPA supplicant), however, I do see the boot debug and output. Trying again with the same setup but instead with a fresh Ubuntu Server ubuntu-20.04.1-preinstalled-server-arm64+raspi.img install allows me to see the boot output as well as login. I've confirmed that the cmdline.txt, config.txt and usercfg.txt files are identical between the Ubuntu Server and Ubuntu-Mate inital installion install files.

Screenshot of the serial console with Ubuntu Server is on the left, Ubuntu Mate Beta2 on the right:


1 Like

Hi, Vincent.

I think you have already solved your problem, but for those who have the same problem, I will describe my solution.

  1. In order to be able to log in via the UART serial console, you need to make the serial-getty service start automatically when you boot Ubuntu Mate:
wakko@radio:~$ sudo su
[sudo] password for wakko: 
radio:~$# partprobe /dev/mmcblk0
radio:~$# mount /dev/mmcblk0p1 /mnt/
radio:~$# cp -p /mnt/cmdline.txt /mnt/cmdline.txt.orig
radio:~$# sed -i 's/ plymouth.ignore-serial-consoles//' /mnt/cmdline.txt
radio:~$# umount /mnt/
radio:~$# mount /dev/mmcblk0p2 /mnt/
radio:~$# ln -s /lib/systemd/system/[email protected] /mnt/etc/systemd/system/oem-config.target.wants/[email protected]
radio:~$# umount /mnt/
radio:~$# exit
  1. Next, load Raspberry Pi from the microSD card and log in as the oem user with the oem password.
  2. You can then install openssh and xrdp to connect to the graphical interface.
  3. After connecting to the graph, manually run the oem-config to complete the installation of Ubuntu Mate.
  4. Then reboot and delete the oem-config and the oem user.

This is in a nutshell. I described the whole process in more detail on my website in this article.

1 Like

I know this is out of topic, but I have posted for help on Ubuntu forums, stack exchange ubuntu, stack exchange raspberry pi and raspberry pi forums and no one has a clue.

So I followed you steps for Ubuntu 21.04 desktop release, because I am trying to install Ubuntu 21.04 on Raspberry Pi 4 without a monitor, keyboard and mouse.

Serial UART, using TTL to USB converter is the only way to install Ubuntu 21.04 onto the Raspberry Pi 4 without a monitor.

I am on a windows 10 system using PuTTY serial console, and I get stuck at the "login" and "password" prompt.
"oem" for login and password are incorrect for Ubuntu 21.04. I also tried all common "login" and "password" credentials and none works.
Anyone here have any clue what I am doing wrong?
Maybe I have to edit the boot files which is specific to the Ubuntu 21.04?
What is the password for Ubuntu 21.04 installer via Serial?

Here is a picture where I get stuck:

Any advice and help will be much appreciated, I spent two full weeks searching google and the interwebs with no help and documentation. Thanks.


I can't tell you exactly, but I can advise you to try version 20.04 and update it to version 21.04 after installation. I also want to note that I tried Ubuntu Mate, and you install Ubuntu Desktop. Perhaps there is an oem user only in Ubuntu Mate.

1 Like

Thanks for replying, sounds like a good idea to use 20.04 but for some reason there are no desktop release for 20.04 and Ubuntu only have the server version for 20.04 which has built-in SSH server included in the distro, which mean the savvy use of UART Serial is not required for a headless install.
Since ubuntu only have 20.04 server release for the Raspberry Pi, it also means I have to go through the hassle and wait long times for manually installing the desktop environment downloading via internet.

Would happen to know if I might be able to manually change, modify, remove or set a "login" and "password" credentials for the Ubuntu installer?

This was actually an easy fix, all I had to do was to add a password into the "etc/shadow" file.

Here is a youtube video on how to do it:

Here is the pic proof I logged into the Ubuntu 21.04 installer as root via UART Serial TTL:

I hope I can start the next process in installing ubuntu now...