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?


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

nohup xvfb-run -a PROGRAM &
  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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