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

By neokrates, written on April 29, 2010

howto

Rate it
  • 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
    Loading ... Loading ...
Ad
Poll
  • Your favorite X-Windows?

    • Don't use X (69%, 9 Votes)
    • GNome (8%, 1 Votes)
    • Kde (8%, 1 Votes)
    • LXDE (8%, 1 Votes)
    • Something else (8%, 1 Votes)
    • Fluxbox (0%, 0 Votes)
    • Enlightenment (0%, 0 Votes)
    • Blackbox (0%, 0 Votes)
    • Xfce (0%, 0 Votes)

    Total Voters: 13

    Vote

    Loading ... Loading ...
Feeds:
  • bodytext bodytext bodytext
Most popular search terms:

You can use Xvfb if your run X-Server-dependent binaries on system without display, mouse and keyboard.

Software:

[v] Ubuntu 9.10
[v] Xvfb (xorg-server 1.6.4)

Should also work for:

[v] 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!

 
Does that help to solve your problem?
VN:F [1.8.5_1061]
Rating: -1 (from 11 votes)
5 votes 'YES'  6 votes 'NO'

LEARN MORE (amazon bookstore)

TAGS

RELATED
Pages
Posts

SOCIAL
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • BlinkList
  • Blogosphere News
  • E-mail this story to a friend!
  • Furl
  • LinkArena
  • Live
  • MisterWong
  • Print this article!
  • StumbleUpon
  • Technorati
  • Webnews.de
  • YahooMyWeb

INCOMING SEARCH TERMS


4 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 800×600x16″ 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.

    Like or Dislike: Thumb up 0 Thumb down 0

  2. HarbingTarbl says:

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

    Like or Dislike: Thumb up 0 Thumb down 0

    • 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 :)

      Like or Dislike: Thumb up 0 Thumb down 0

Leave a Reply