Xvfb

From GHER

Revision as of 10:22, 22 September 2008 by Abarth (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Xvfb allows to run GUI programs without a screen. This is useful to use a GUI program like ODV for web applications.

Under ubuntu, the helper script xvfb-run can be used:

xvfb-run ./odvmp_fedora6

If xvfb-run is not available or if more than one application has to be started, the following steps can be done:

Contents

Preparation

AUTHFILE=/tmp/xvfb.$$.Xauthority
XAUTHORITY=$AUTHFILE xauth add :99 .  $(mcookie)
XAUTHORITY=$AUTHFILE  Xvfb :99 -screen 0 640x480x8 -extension Composite -nolisten tcp &
XVFBPID=$!

Start the program

XAUTHORITY=$AUTHFILE ./odvmp_fedora6 -display :99 &

Get a screen-shot

XAUTHORITY=$AUTHFILE xwd -display :99 -root -out image.xwd

Clean-up

kill $XVFBPID
kill -9 $XVFBPID
XAUTHORITY=$AUTHFILE xauth remove ":99"
rm -f $AUTHFILE
Personal tools