VNC logo

Virtual Network Computing
from ORL


[getting started]
[keep in touch]

Getting Started with VNC

VNC consists of two types of component.  A server, which generates a display, and a viewer, which actually draws the display on your screen.   There are two important features of VNC:

  • The server and the viewer  may be on different machines and on different architectures.  We expect the most common use to be the display of a Unix X desktop on a PC, for example.  The protocol which connects the server and viewer is simple, open, and platform- independent.
  • No state is stored at the viewer. Breaking the viewer's connection to the server and then reconnecting will not result in any loss of data.  Because the connection can be remade from somewhere else, you have easy mobility.

So, to get started with VNC you need to run a server, and then connect to it with a viewer.  There is a Windows server, WinVNC, but for the purposes of this introduction we will use the X-based server, Xvnc, so you will need access to a Unix machine. WinVNC is actually simpler - you just run it on one machine and then tell the viewer  to connect to this machine - but it has some limitations, so we'll start with X.  The current VNC software requires a TCP/IP connection between the server and the viewer, though there is no reason why the software couldn't be modified to use, for example, RS232 or Firewire.  We have internal versions that use other network transport layers.

Running a server

A VNC server appears to Unix applications to be a standard X display.  You can start a new server by typing:


on a Unix machine.  (On a PC you may need to telnet to the Unix machine to get a command shell into which you can type this.)  The vncserver program is a Perl script which you may need to edit to set up the directories appropriate for your local installation.

If you haven't run a VNC server before you will be prompted for a password, which you will need to use when connecting to this server. All your servers will use the same password, and you can change it using


With a normal X system, the main display of a workstation snoopy is usually snoopy:0. You can run as many VNC servers on a machine as you like, and they will appear as snoopy:1, snoopy:2 etc.  You can cause applications to use them by setting the DISPLAY environment variable to the VNC server you want, or by starting the application with the -display option. For example:

xterm -display snoopy:2 &

Normally vncserver will choose the first available display number and tell you what it is, but you can specify a display number if you always wish to use the same one:

vncserver :2

Nothing will appear immediately as a result of starting a server. To see anything you need to connect a viewer to the server.

Running a viewer

If you have started a server as display 2 on machine snoopy, you can start a viewer for it by typing:

vncviewer snoopy:2

With the Windows viewer, if you don't specify the server on the command line, you will be prompted for the host name and display number:

Connection dialog

Click OK, and you will be prompted for your password, after which you should  see the display.

Using Java

The VNC servers also contain a small web server, which can serve the Java classes needed for a browser to connect back to the server.  You can then see your desktop from any Java-capable browser. For some servers you will need to specify the location of the class files when starting the VNC server. The server listens for HTTP connections on port 5800+display number.  So to view server 2 on machine snoopy, you would point your web browser at:


The applet will prompt you for your password before displaying the desktop.


That's it!  For more technical details see the documentation


Copyright 1998 - The Olivetti & Oracle Research Lab