Computer Laboratory

Warning: This page may be out of date and was last reviewed in 2005.

Some hints for the use of vnc

vnc uses an optimised 'thin-client' protocol to offer machine independent display (e.g. under X, Windows or in a Web Browser) of Windows and X sessions.

The client, vncviewer (3.3.4), is installed on Linux machines. Alternatively, use a Java enabled viewer to access port 5800+n.


A sample use of the X client is

vncviewer &
which will open a window onto host.nt and destroy any existing connection. If the '-shared' flag is used, any existing connection remains. Note that if the other connection is slow (e.g. java) it makes the X connection slow as well.

F8 is used to display a small menu which includes operations such as Full Screen, Send F8 and Send Ctrl-Alt-Del. Take care setting Full Screen Mode as it may be hard to leave it.


The vnc server also incorporates an HTTP server which can provide a java client to display the window. This is noticeably slower, and wastes a fair amount of screen space. However, it is machine independent, and can be used from any java capable browser. Before opening a connection, enable java, and remember to disable it when you have finished. Then open the URL
to access :1

To connect without destroying any existing connections, select 'shared' from the 'Options' box.


To be used, WinVNC has to be started on the NT box first, either automatically at boot time, or manually by the logged in user.

On Linux, the server (3.3.41) should be available in /usr/opt/vnc/bin/vncserver and is useful for starting up a VMWare machine without tying it to an X server.

Remote access

Direct remote access to the Lab is not available, as it is insecure. Instead, use ssh's tunnelling facilities, by first opening a connection such as

ssh -L 5902:localhost:5901 -L 5802:localhost:5801
which will arrange to tunnel traffic directed to the local ':2' ports on the local machine to the ':1' ports on host, Then connect to localhost:2, e.g.
vncviewer localhost:2 &
netscape http://localhost:5802 &

External Windows client to internal Linux server

Many Windows users experience problems with PuTTY and eXceed sessions dying when there are minor network problems, making the use from home Windows machines unreliable. One option is to run a vnc X server on the Linux machine, and then use PuTTY tunnelling.

Below are instructions for connecting via ssh-relay1 to a server on host foo (your normal workstation) using its 'X' server number R (0 is the main X server, 1 is the secondary [used by some people], 10+ are ssh X11 forwarding relay, and 25 is the xc proxy, so 5 may be a good number) such that it can be connected to using the VNC viewer as session P (probably less confusing if it is the same as R).

Ensure that pageant is set up, and has suitable user keys as converted by puttygen

Linux Server Setup

The first step is to start the vnc server on the Linux machine.

As a one off, it is necessary to generate a password for the server, and tailor the startup. The vncpasswd command will set up ~/.vnc/passwd. Edit $HOME/.vnc/xstartup to set a suitable WM etc.

Each time the machine reboots, the Xvnc server has to be started. Find an unused X server number (R in this example) and start the server with the required geometry (note that it cannot be changed), e.g. 'vncserver :R -geometry 1280x1024'.
Keeping the screen resolution low may be of use if a slow link is used.
If the client resolution is the same as the server, use full screen mode. The command line flag -fullscreen selects this. Pressing F8 brings up the pop-up which allows fullscreen mode to be enabled and disabled.
If the client resolution is less than the server and fullscreen mode is selected, it will pan as the edge of the screen is hit.

Windows client PuTTY port forwarding

Set up a PuTTY connection which makes a connection to ssh-relay1 and forwards local port 580P to port 580R on
  • Set Connection -> Auto-login username to user
  • In SSH -> Tunnels -> Forwarded ports: set Local, set Source port to 590P, set Destination to, click Add to allow VNC client access.
  • In SSH -> Tunnels -> Forwarded ports: set Local, set Source port to 580P, set Destination to, click Add to allow web access.
  • Set Session -> Host Name to
  • Set Session -> Protocol to SSH
  • Set Session -> Saved Sessions to foo-vnc-R
  • Click Session -> Save
Examples with P = R = 5, user = pb, foo = greta.
[port connection][port forwarding][port session]

Linux client ssh port forwarding

Setup a connection using xon or a forgrounded ssh connection, e.g.
  • xon ssh-relay1
  • ssh ssh-relay1
Then use 'vncviewer localhost:P' to connect.

Windows VNC viewer

Start the VNC viewer, select the server as localhost:P, click OK, type the VNC password, then click OK.
Alternatively connect to http://localhost:580P using a java enabled browser.
[vmcc connection][vnca forwarding]