Run Headless Ubuntu on an Atom Z8350 PC

If you search for Linux PC on Amazon this cute near $100 PC shows up. It comes with fake Windows and claims to support Linux (Debian). I immediately formatted the drive and installed Ubuntu. What followed was hours of agony…

The mini ‘Linux PC’ based on Atom Z8350 (2G/32G)

I’ve included the steps required to get the PC up and running but my experience was that the machine crashed frequently no matter how kind I was nor which OS was running. I’m still working on making this robust.

Boot into Bios — Select the Wifi Chip

Booting into the Bios requires that you press/hold the Delete key during boot. Specifically, the key that says “Delete” on it, not the Del key on the numeric pad.

The BIOS itself is incredibly primitive. Mainly it lets you set boot order and pick which network chip is installed — as if you have any idea. Mine was set to AP6255, which turned out to be correct. Reset the boot order so it boots from USB Disk first so you can install.

Install Lubuntu

Install with autologin (an option during the installation) so that it starts up a user console automatically. This is not secure but the computer isn’t going anywhere and it has no input nor output devices. I installed the minimal installation. The full installation is much simpler to do wireless but the screen sharing feature I had trouble with. There’s a version created specifically for these boxes available here that was the most stable distribution I tried.

Fix Power-Saving Atom Crash

I installed Ubuntu and Lubuntu and … and all of them ran for a few seconds then crashed. It turns out that there’s a known bug with the Atom and power saving modes. To repair the constant crashing add an option to the bootup cycle to disable the power-saving.

sudo nano /etc/default/grub

Change the line with GRUB_CMDLINE_LINUX_DEFAULT and add “intel_idle.max_cstate=1”. On my system that became

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"

Enable Wifi

The Wifi situation is complicated. The Z83W has a Broadcom Wifi chip inside of it that requires a driver. To get the driver, download this link then take that file and copy it to /lib/firmware/brcm/brcmfmac43455-sdio.txt. Note that this file is specific to the hardware and won’t work with all mini systems necessarily.

Once rebooted, available wifi networks should show up in the network gui on the bar.

Connect to Wireless Network

If you can’t use the GUI, the simplest approach is to edit /etc/network/interfaces and add a section.

auto wlan0
iface wlan0 inet dhcp
wpa-ssid theNetworkSsid
wpa-psk thePassword

After a reboot the wireless connects to network and we’re off.

Install SSH

We want to use SSH and VNC to connect, so install the SSH server.

sudo apt install ssh

Get VNC to work Headless

This is harder than it sounds. As usual answers differ depending on flavors.

On Lubuntu, this just works if you run the x11vnc line manually or in .profile.

#you may change resolution by creating a frame buffer first
xrandr --fb 2048x1280 -d :0
# now run the server in background
/usr/bin/x11vnc -xkb -auth /var/run/gdm3/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /var/log/x11vnc.log

On Ubuntu 18.04 with the minimal installation, primarily the answer is: see here. The trick is to install a virtual screen driver (xserver-xorg-video-dummy) and then use it at startup instead of a monitor. Otherwise the screen never initializes headless. Install the driver and add the xorg.conf file as described. Then reboot.

I used x11vnc, which seemed recommended. It installed comfortably and it can run with the virtual screen driver.

First, create a password file in etc.

# Create the password file
sudo /usr/bin/x11vnc -storepasswd /etc/x11vnc.pass
# I often want to access from user account so...
sudo chmod 666 /etc/x11vnc.pass
# Create a blank log file
echo 0 >x11vnc.log
sudo cp x11vnc.log /var/log
sudo chmod 666 /var/log/x11vnc.log

Use this invocation (here the gdm3 folder is where the desktop manager lives and the log file was just created).

/usr/bin/x11vnc -xkb -auth /var/run/gdm3/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -o /var/log/x11vnc.log
Like what you read? Give Mark Zachmann a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.