VNC

VNC is a very useful software package allowing your to see, and interact with, a remote machine as though you were sat at that machine. It is a two step process, you run a server program on the remote machine and a viewer on your local machine.

Here is a recipe for using a remote machine (grus) while you are sat at a machine called pavo.

ssh to grus and type:

vncserver -geometry 1280x1024
The 1280x1024 parameter depends on the resolution setting of the remote machine (grus), 1280x1024 is good starting point. You will be asked to supply a session password, do this. You will also be given a session name of the form: grus.star.bris.ac.uk:1

The first time you do this, you will have to edit the file:

~/.vnc/xstartup
and uncomment the first two lines that say:

 unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc
On the local machine, pavo, type:
 vncviewer grus.star.bris.ac.uk:1 -fullscreen               
You will be asked for your session password, and a desktop on grus will pop up and fill your screen.

To get out of this, use the F8 key. This gives you the option to terminate the session. Remember the F8 key is the magic key....

When you are finished, you can terminate your session on the remote machine, by running the following command.

 vncserver -kill grus.star.bris.ac.uk:1
However, you may wish to leave your session running, as you can reconnect to it from another machine later, and carry on where you left off.

Doing it securely

If you follow the instructions above, then although your initial connection via your session password is encrypted, all subsequent traffic is not, and can therefore be evesdropped on. The solution to this is to tunnel the VNC connection over ssh, so that all traffic between your machine and the remote machine is encrypted and looks like gibberish to an interloper. This is actually very simple to do. When you first log on to the remote machine (grus) use the following form of the ssh command:
 ssh -L 5902:localhost:5901 grus
and start the vncserver as before, ie:
vncserver -geometry 1280x1024
and use the following form for the vncviewer command, but in another window, as the ssh command needs to continue running.
vncviewer localhost:2
Again, when you are finished, you can terminate your session on the remote machine, by running the following command.
 vncserver -kill grus.star.bris.ac.uk:1

VNC clients or viewers

For Linux, you can use vncviewer.
For Linux,Windows,MacOS X and Solaris, try freenx from http://www.nomachine.com/
For MacOS X try Chicken of the VNC.

Gotchas

KDE desktop seems to work better than gnome, so you may need to edit your ~/.vnc/xstartup file to run startkde instead of gnome-session.


Rhys Morris
Last modified: Wed Oct 22 14:23:01 BST 2008