Xwindows apps on headless server
From Initq
A few days ago i came across an issue where i needed to run some java apps on my server but i never install xwindows on servers at all. This app needed xwindows libraries and also would put up a window. After searching i came across xvfb.
Get it by:
- apt-get update && apt-get install xvfb
xvfb provides an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb framebuffer using virtual memory. The primary use of this server was intended to be server testing, but other novel uses for it have been found, including testing clients against unusual depths and screen configurations, doing batch processing with Xvfb as a background rendering engine, load testing, as an aid to porting the X server to a new platform, and providing an unobtrusive way to run applications that don't really need an X server but insist on having one anyway.
The package gives you a nice script called xvfb-run which simplifies the automation of X.
#!/bin/bash #************************************************************ #* batch file to run ant build process * #************************************************************ JAVA_HOME=/opt/apptricity/jdk1.6.0_18 ANT_HOME=/opt/apptricity/apache-ant-1.8.0 APPTRICITY_ERM_HOME=/opt/apptricity/apptricity_erm_40 APPTRICITY_PROPERTIES=/opt/apptricity/apptricity_erm_40/fax/invimport/invimport.properties /usr/bin/xvfb-run -a $ANT_HOME/bin/ant -Dappserver.jboss=true -Djava.awt.headless=true -Dapptricity.properties=$APPTRICITY_PROPERTIES -buildfile /opt/apptricity/apptricity_erm_40/fax/invimport/invimport.xml all -verbose
As you can see above that we tried the -Djava.awt.headless=true flag already but it did not work so i left it in there anyway.