Skip to content

Headless System with X Server

David Rohr edited this page May 15, 2015 · 1 revision

Headless System Setup

This is a short description showing how to setup a headless system without having to attach a monitor to your system at all. For the example openSUSE and Ubuntu are used, it should however be easily transferable to other systems. Please note, that there is also a guide by AMD on how to do that. It didn't really work for me, though. Opposed to the ATI example this guide uses xdm, which is the most lightweight display manager available and has also proven to be more stable than gdm.

Required Software

You can start with a minimal system setup. You will only have to add XDM and the ATI driver.

openSUSE

XDM is contained in the xorg-x11 package. To install execute the following:

zypper in xorg-x11

In newer versions of SUSE, e.g. 11.4 you will also have to install xorg-x11-server, as otherwise you will be missing /usr/bin/X.

You can install the ATI driver via Yast by adding the appropriate community repository. The version provided via Yast however is often not the most recent, so you might want to just run rpm --install ati.rpm* in a directory containing a self-built driver RPM.

You can build the driver RPM on any machine with X, kernel-headers and the usual build tools installed. Just download it from the AMD webpage and execute the following:

./ati-driver-installer-10-12-x86.x86_64.run --buildpkg SuSE/SUSE113-AMD64

You will have to adjust the argument to your specific variant of Linux. A list of options can be retrieved via ./ati-driver-installer-10-12-x86.x86_64.run --listpkg.

Ubuntu

To install XDM execute the following:

aptitude install xdm

It might ask for the display manager to use, choose xdm so that it will automatically update your system init scripts.

You can build the driver debian package on any machine with X, kernel-headers and the usual build tools installed. Just download it from the AMD webpage and execute the following:

./ati-driver-installer-10-12-x86.x86_64.run --buildpkg Ubuntu/lucid

You will have to adjust the argument to your specific variant of Linux. A list of options can be retrieved via ./ati-driver-installer-10-12-x86.x86_64.run --listpkg.

System configuration

First create a valid X configuration using your ATI video device:

aticonfig --adapter=all --initial

Now you will have to configure the display manager.

openSUSE

You will have to modify two files, just scan for the values and adjust as given.

/etc/sysconfig/displaymanager:

DISPLAYMANAGER="xdm"
DISPLAYMANAGER_REMOTE_ACCESS="yes"
DISPLAYMANAGER_ROOT_LOGIN_REMOTE="yes"
DISPLAYMANAGER_XSERVER_TCP_PORT_6000_OPEN="yes"

/etc/X11/xdm/xdm-config:

DisplayManager._0.authorize:    false

Ubuntu

You will have to modify the file /etc/X11/xdm/xdm-config:

DisplayManager*authorize: false

User environment configuration

To use the GPU from the console you will need to set DISPLAY=:0 in your environment. To do this for all users you can add export DISPLAY=:0 to /etc/bash.bashrc.local. This has one disadvantage, though: It will break X forwarding, making it impossible to run applications like gitk. To avoid this you might want to utilize the following code snippet that only sets the DISPLAY variable if it is unset:

case "$DISPLAY" in '') export DISPLAY=:0;; *)  echo -e "\033[1;31mYour DISPLAY is set. To use the local GPU export DISPLAY=:0\033[0m" ;; esac

Starting with APP 2.4 you should however rather set COMPUTE=:0, as this will not clobber your DISPLAY variable, thus allowing you to use your AMD GPU for compute even while utilizing X-forwarding.