Try using xvfb to simulate an X11 environment