Straight flush      PokerApp title  Poker chips

SourceForge.net Logo


  PokerApp Home   Forum   Help / FAQ
  Download   Development   SourceForge Project Page

Getting and Installing Xvfb for Linux

 

The PokerApp server can be run from a Linux console (without a window manager) - using a command like java -jar PokerApp.jar --server --port=##### --nogui.  This can be very useful to start a server on a remote Linux machine by accessing it via PuTTY or some other remote terminal program.

However, because of the way Java loads the java.awt classes, an X server must be present or you will get an error: 

Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.

This can be overcome, but it requires starting an X server with a virtual frame buffer (rather than using the screen as a frame buffer).  A program called Xvfb can do just this.  Xvfb is usually an optional part of a standard X installation, so there is a good chance you might have to follow these instructions to install it.


Getting / Installing Xvfb

First thing:  Make sure its not already installed - if the file Xvfb doesn't exist anywhere, then its not installed.  It will probably be in the same directory as your X executable.  ($X11_DIRECTORY/bin/Xvfb)

If you have it, check out "Running Xvfb" below.  If you don't have it, keep reading here...

 


Running Xvfb and starting the PokerApp server

Running Xvfb is pretty simple once you have it installed.  Just use the following commands

  1. export DISPLAY=localhost:99.0

     

  2. /usr/X11R6/bin/Xvfb :99 -screen 0 1x1x8 &

     

  3. java -jar PokerApp.jar --server --port=##### --nogui

     

 

 

To stop the PokerApp server and Xvfb, do the following:

  1. Press Ctrl-C as This will stop the PokerApp server.
  2. At the prompt, type fg and press enter.  This will bring the X server to the foreground.
  3. Now press Ctrl-C again to stop the X server.
  4. If you want to now run an X session on you machine, remember you will have to set your DISPLAY variable back to localhost:0:0 (or whatever it was before you changed it) 

If you have any questions, post them to the PokerApp forum - other folks who have done the same thing as you may be able to help.