Start and use Xvfb, enable X-server on headless systemBy neokrates, written on April 29, 2010 |
howto |
You can use Xvfb if your run X-Server-dependent binaries on system without display, mouse and keyboard.
Software:
✔ Ubuntu 9.10
✔ Xvfb (xorg-server 1.6.4)
Should also work for:
✔ Other Linux distros
Get Xvfb:
sudo apt-get install xvfb
Start:
Xvfb :1 -screen 0 800x600x16
If you see plenty of complains but no ERROR, it’s ok in most cases:
me@myhost:/my/path # >Xvfb :1 -screen 0 800x600x16 error opening security policy file /etc/X11/xserver/SecurityPolicy (EE) XKB: Couldn't open rules file /usr/share/X11/xkb/rules/base Could not init font path element /usr/share/fonts/X11/cyrillic, removing from list! Could not init font path element /usr/share/fonts/X11/100dpi/:unscaled, removing from list! Could not init font path element /usr/share/fonts/X11/75dpi/:unscaled, removing from list! Could not init font path element /usr/share/fonts/X11/Type1, removing from list! Could not init font path element /usr/share/fonts/X11/100dpi, removing from list! Could not init font path element /usr/share/fonts/X11/75dpi, removing from list! [config/hal] couldn't initialise context: (null) ((null)) FreeFontPath: FPE "/usr/share/fonts/X11/misc" refcount is 2, should be 1; fixing.
Now, Xvfb will listen on server :1. To make use of it, the DISPLAY environment variable must point to :1.0.
DISPLAY=:1.0
Have fun!
|
LEARN MORE (amazon bookstore)
|
|
TAGS
|
|
SOCIAL
|
|
INCOMING SEARCH TERMS
|



So, what’s next?
I typed “Xvfb :1 -screen 0 800x600x16” and got the similar output on tty1, and then I switched to tty2 and typed:
But nothing appeared on tty1.
What exactly did you expect? What are you trying to achieve??
“Xvfb or X virtual framebuffer is an X11 server that performs all graphical operations in memory, not showing any screen output”
(http://en.wikipedia.org/wiki/Xvfb)
Why do you use DISPLAY=:1.0 and not DISPLAY=:1 ?
Does the .0 add something to the command?
Hi HarbingTarbl
no, in this case it doesn’t. I.e 1.0 = 1
Why… In this case it makes no difference actually, so it just works both. Sometimes it would make difference, here is a bit of theory :
as I know, format is
DISPLAY = $HOST:$DISPLAY_NUM.$SCREEN_NUM.Now, if
$HOSTis omitted that’slocalhost.$DISPLAY_NUM = 1. is saying, use display 1 (default) attached to the box. My be virtual though, not real hardware.$SCREEN_NUM = 0. means, first, or default, screen. (In case display has many screens, which might be)cheers :)
[…] Approach 1 […]
[…] Start and use Xvfb, enable X-server on headless system – ThinkPlexx – Apr 29, 2010. You can use Xvfb if your run X-Server-dependent binaries on system without display, mouse and keyboard. Software: ? Ubuntu 9.10. ? Xvfb (xorg-server 1.6.4 ). error opening security policy file /etc/X11/xserver/SecurityPolicy. […]