Headless VNC-Server using xvfb

This article gives a brief description of how to setup an VNC server on a headless machine by using the virtual frame buffer xserver. We use the “ratpoison” window manager for example, but any other WM could be used as well.

On a Debian based system, you need to apt-get the following:

On the server machine install:

apt-get install xvfb
apt-get install x11vnc
apt-get install ratpoison
apt-get install xterm
apt-get --reinstall install xfonts-base

Start the virtual frame buffer and the WM (e.g. ratpoison) on the server machine:

Xvfb -screen 0 800x600x16 -ac &
DISPLAY=:0 ratpoison &

Then on the client machine connect to the VNC server. We use an SSH tunnel to the server and redirect the local port 5900 to the servers port 5900 (which is where the VNC server listens):

ssh -l kaltpost -L 5900:localhost:5900 kaltpost.de 'x11vnc -localhost -display :0'

Thus we are able to connect the VNC viewer on our client to localhost:

vncviewer localhost

An empty desktop window should now pop-up. You could use the following ratpoison commands:

  • xterm mit “Ctrl-t c”.
  • Frame wechseln “Ctrl-t f” + Nummer
  • Frame horiz./vert. splitten “Ctrl-t s”, “Ctrl-t S”
  • Fenster wechseln die innerhalb eines Frames liegen “Ctr-t n”
  • Frame löschen mit “C-t R”,
  • Alle Frames killen mit “C-t Q”

:-) or may be just install some other WM like fluxbox …

Leave a Reply

You must be logged in to post a comment.