April 06, 2011 | Published in Waterloo 4B
A while ago, I needed to create some quick graphs, and I didn’t feel like installing a ton of libraries on my Windows laptop just for this. So, I did it on my VPS instead (running Ubuntu Server), and it was surprisingly easy. Also, you can admin your Linux server with a graphical using interface with this if you don’t feel like doing it using the command line. The best part of this is you don’t need to install anything on your main machine since you can access the VNC session through your browser (thanks to the java-vnc viewer).
Install the packages you need:
sudo apt-get install xvfb x11vnc vnc-java blackbox xterm
Start an X Server:
Xvfb :1 -screen 0 1024x768x16 -ac &
Start a window manager:
DISPLAY=:1 blackbox &
Configure the display variable:
Start VNC with a web viewer:
x11vnc -display :1 -httpdir /usr/share/vnc-java -httpport 5800 -forever &
Now you can access the VNC session through your browser at:
The only other configuration needed is that you need to open ports 5800 and 5900 (possibly 5901 as well).
Finally, you can also just run a VNC server, but then you need a VNC client. The steps are the same except replace the starting VNC step with
x11vnc -display :1.