Start and use Xvfb, enable X-server on headless system

By neokrates, written on April 29, 2010

howto

  • Join date: 11-30-99
  • Posts: 224
View Counter:
  • 10,148 views
Rate it
Ad
Poll
  • Your favorite X-Windows?

    View Results

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext

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!

Be Sociable, Share!
 
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: 0 (from 18 votes)
9 votes 'YES'  9 votes 'NO'

LEARN MORE (amazon bookstore)

TAGS

SOCIAL
Be Sociable, Share!

INCOMING SEARCH TERMS


5 Responses to “Start and use Xvfb, enable X-server on headless system”

  1. eXerigumo Clanjor says:

    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:

    export DISPLAY=”:1.0″
    xeyes

    But nothing appeared on tty1.

  2. HarbingTarbl says:

    Why do you use DISPLAY=:1.0 and not DISPLAY=:1 ?
    Does the .0 add something to the command?

    • admin says:

      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 $HOST is omitted that’s localhost.
      $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 :)

Leave a Reply