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?
1 Answer
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 linex-window-manager &
and insertopenbox-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:
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 installinggnome-terminal
, etc.
-
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).– PeteJun 13, 2012 at 3:37 -
Is there a way to connect using certificates, like ssh, or are we limited to passwords?– PeteJun 13, 2012 at 14:16