odroid-xu4:application_note:software:headless_setup

Headless Setup with Ubuntu Mate

This is a step-by-step guide of how to test ODROID boards.
It assumes that you want to run headless, that is, access it via network connections without a keyboard or display.
This guide is based on Hardkernel's Ubuntu Mate environment.

You HAVE:

  • ODROID-XU4/HC1/HC2
  • SD card or eMMC (installed Ubuntu Mate)
  • Ethernet cable
  • Linux PC
  • A switching hub
  • DHCP network

You do NOT have:

  • USB keyboard
  • USB-UART Module Kit
  • HDMI cable/monitor

Connect the ODROID to a spare Ethernet port on your switching hub using an Ethernet cable.

Insert the SD card (or eMMC) into the ODROID-XU4.

Turn on the ODROID-XU4 and it will run the root file system resizing process automatically.
After resizing process, it will shutdown and the blue LED is off within 5~20 seconds.
Press power button again and the heartbeat blue LED keeps flashing.

Ping scan to update ARP table:

host
brian@brian-desktop:~$ nmap -sn 192.168.100.0/24
Starting Nmap 7.01 ( https://nmap.org ) at 2016-05-17 15:09 KST
Nmap scan report for 192.168.100.1
Host is up (0.00066s latency).
Nmap scan report for 192.168.100.2
Host is up (0.000084s latency).
Nmap scan report for 192.168.100.3
Host is up (0.00046s latency).
Nmap scan report for 192.168.100.53
Host is up (0.00066s latency).
Nmap scan report for 192.168.100.68
Host is up (0.095s latency).
Nmap done: 256 IP addresses (5 hosts up) scanned in 2.43 seconds

Check the ODROID-XU4 IP address: (NOTE: “00:1e:06” is start MAC address for ODROID boards.)

host
brian@brian-desktop:~$ arp -a | grep 00:1e:06
? (192.168.100.53) at 00:1e:06:33:0d:45 [ether] on enp0s25

On your Linux PC, type “ssh odroid@xxx.xxx.xxx.xxx”, where “xxx.xxx.xxx.xxx” is the IP address you discovered in the previous step.

It will then prompt for your password.
Type in the default password: odroid

host
brian@brian-desktop:~$ ssh odroid@192.168.100.8
The authenticity of host '192.168.100.8 (192.168.100.8)' can't be established.
ECDSA key fingerprint is SHA256:BCqiwzdtSViFOSAbgNHw35avUvOTHikW+fx7N4v+Lv0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.100.8' (ECDSA) to the list of known hosts.
odroid@192.168.100.8's password: 
Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 4.14.28-124 armv7l)
 
 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
 
0 packages can be updated.
0 updates are security updates.
 
Last login: Tue Mar 20 07:39:48 2018 from 192.168.100.2
odroid@odroid:~$ 

In a headless system, you may want to let the X server automatically login. This is done differently in various versions of Ubuntu, unfortunately. For Ubuntu Mate 18.04, create a new file in /etc/lightdm/lightdm.conf.d/12-autologin.conf using

sudo vi /etc/lightdm/lightdm.conf.d/12-autologin.conf

. The file should look as follows. Substitute your chosen userid :

[SeatDefaults]
autologin-user=odroid
autologin-user-timeout=0

Then, you can restart the X server with :

sudo service lightdm restart

Ubuntu Mate will then no longer prompt for user login.

  • Make sure Ubuntu MATE installed before following this guide. An minimal image hasn't necessary dependencies including X11 to start VNC server.

Connect to the ODROID-XU4 using SSH.

host
brian@brian-desktop:~$ ssh odroid@192.168.100.8
The authenticity of host '192.168.100.8 (192.168.100.8)' can't be established.
ECDSA key fingerprint is SHA256:BCqiwzdtSViFOSAbgNHw35avUvOTHikW+fx7N4v+Lv0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.100.8' (ECDSA) to the list of known hosts.
odroid@192.168.100.8's password: 
Welcome to Ubuntu 16.04.4 LTS (GNU/Linux 4.14.28-124 armv7l)
 
 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage
 
0 packages can be updated.
0 updates are security updates.
 
Last login: Tue Mar 20 07:39:48 2018 from 192.168.100.2
odroid@odroid:~$ 

Install VNC server using apt package management. At the first boot, the dpkg lock may be in use, and you might not be able to run apt update while initial updates run in the background. If you run into this, you can initiate a second reboot, which will wait for a while until these updates load, and then run :

target
odroid@odroid:~$ sudo apt update
odroid@odroid:~$ sudo apt install x11vnc

Run VNC server.

target
odroid@odroid:~$ x11vnc -display :0 -auth guess

Connect to the ODROID-XU4 VNC server from your Linux PC.

  • If you don't have any VNC Viewer, enter below to install.
host
brian@brian-desktop:~$ sudo apt install tigervnc-viewer
host
# usage: vncviewer {ODROID_IP}
brian@brian-desktop:~$ vncviewer 192.168.100.8

There are several methods you can use to change the resolution. Both involve editing configuration files.

Change resolution in xorg.conf

You can change resolution by editing /etc/X11/xorg.conf file.

target
odroid@odroid:~$ sudo vi /etc/X11/xorg.conf

Append this to the end. See DefaultDepth and Virtual parts.

Section "Screen"
        Identifier      "Default Screen"
        Device          "Mali-Fbdev"
        DefaultDepth    24
        SubSection "Display"
                Virtual 1920 1080
        EndSubSection
EndSection

Change resolution in boot.ini

Instead of editing xorg.conf, you can also choose to setup headless mode for the integrated GPU at boot time. When no display is attached, the GPU will default to 1024×768. You can force it to another resolution.

sudo vi /media/boot/boot.ini

Uncomment the following line to select 1920×1080 for example. You can choose another mode, but make sure to choose one that's listed as “no_edid” in the comments :

setenv videoconfig "drm_kms_helper.edid_firmware=edid/1920x1080.bin"

And also change :

setenv HPD "true"

to

setenv HPD "false"

Then issue :

sudo reboot

Start VNC server and connect


Install x11vnc server as a service

Once you have the x11vnc server running successfully, you may want to run it as a service so that it automatically starts on boot. If so, create a new file called /etc/systemd/system/x11vnc.service using the command

vi/etc/systemd/system/x11vnc.service

The file should look as follows. You may edit your userid, port, and password file.

[Unit]
Description=x11vnc
After=display-manager.service

[Service]
Type=simple
Environment=DISPLAY=:0
User=odroid
ExecStart=/usr/bin/x11vnc -loop -forever -bg -rfbport 5900 -xkb -noxrecord -noxfixes -noxdamage -shared -norc -auth /run/user/120/gdm/Xauthority -rfbauth /home/odroid/.vnc/passwd
Restart=always
RestartSec=1

[Install]
WantedBy=graphical.target

Then, add it as a systemd service, and start it :

sudo systemctl enable x11vnc.service
sudo systemctl daemon-reload
sudo systemctl start x11vnc.service

If you face a problem with starting VNC server using command the below,

target
odroid@odroid:~$ x11vnc -display :0 -auth guess

You can try out by finding out exact paths for those parameters, -display and -auth.

Enter the following command to find out current running X-window with its parameters.

target
odroid@odroid:~$ sudo ps -ef | grep X
root       630   602  0 01:32 tty7     00:00:03 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
root      1266  1006  0 01:38 pts/0    00:00:00 grep --color=auto X

From that results, :0 is the current display on the board and /var/run/lightdm/root/:0 is the current auth file path. So you can enter,

target
odroid@odroid:~$ x11vnc -display :0 -auth /var/run/lightdm/root/:0

to open VNC server.

  • odroid-xu4/application_note/software/headless_setup.txt
  • Last modified: 2020/06/17 19:47
  • by helpodroid