You could try to run it using xvfb-run from the Xvfb project. It starts your application(s) under a fully compatible X Window server without any hardware and not a lot of overhead.
I've used this a few times to run UI tests and for an X11 desktop app that had command line arguments for use on the command line.