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've got a remote Ubuntu box (a Linode) that I need to run a Java program which is not headless (it has a GUI window). I am having the worst time trying to get this to work. I don't need a whole desktop, just a window. Starting with a minimally installed Ubuntu, can you recommend a lightweight strategy for doing this?

share|improve this question
up vote 2 down vote accepted

Do the following to get it running on your VPS. Once you SSH in, do the following:

sudo apt-get install vnc4server openbox
vncserver # enter password, verify
vncserver -kill :1
  • Now open up ~/.vnc/xstartup, comment out the last line x-window-manager & and insert openbox-session & instead.

  • Start VNC with vncserver -- ensure port 5901 incoming is open if you have a firewall enabled.

  • Connect to display 1 (or port 5901) with any VNC client. You'll get the gray openbox-session background along with a default xterm and some VNC options:

    enter image description here

  • Start your programs which need a GUI, etc. Right-clicking anywhere will let you open more terminals. You can change the default terminal to something other than xterm by installing another terminal emulator. I recommend sakura as it's lighter than installing gnome-terminal, etc.

share|improve this answer
Thank you so much for posting this. There's not a straightforward tutorial like this anywhere on the Internet. I had to export DISPLAY=mybox:1 before running the Java program. For the VNC client I got "SSL/SSH VNC viewer" from the Ubuntu Software Center. I could not get it to connect through SSH, but it worked when I changed authentication to "None" (sounds bad). – Pete Jun 13 '12 at 3:37
Is there a way to connect using certificates, like ssh, or are we limited to passwords? – Pete Jun 13 '12 at 14:16

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.