Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a headless Ubuntu-server running at work, and I connect to it from my home Windows machine through Putty. I've logged in with putty, and I need to run a program back at the server (a java package) but it won't run without an X11 display. This is the error I get:

No X11 DISPLAY variable was set, but this program performed an operation which requires it.

I've never used a remote graphical session before, so correct me if I speak nonsense. The thing is, I don't really need a gui to interact with this software, I just need it to run as if there was a gui. So, what's the easiest way for me to get it to run on the server via remote login? It can be an actual display session, or some kind of emulated display that the application could output to. The important is that I can start it from a command-line-only Putty window, and that it won't stop when I log off.

I read that xvnc might do the trick, but I didn't get how to do it.

Was I clear enough?

share|improve this question
up vote 10 down vote accepted

I recommend xvfb-run which will fake an X server for the program you want to run:

nohup xvfb-run -a PROGRAM &
share|improve this answer
The command ran fine, but I still get the same error when trying to run the program. How do I get the program to use the fake x server? – Malabarba Nov 22 '10 at 23:26
Sorry, I wasn't clear in my example. Replace "xterm" with the program you want to run. – Kees Cook Nov 22 '10 at 23:28
Ok, it works, but I had add an -a argument. – Malabarba Nov 22 '10 at 23:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.