Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

1 Answer 1

up vote 9 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? –  Bruce Connor 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. –  Bruce Connor Nov 22 '10 at 23:48
add comment

Your Answer

 
discard

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.