Virtual Network Computing (VNC)

Introduction

In computing, Virtual Network Computing (VNC) is a graphical desktop sharing system that uses the RFB Remote Frame Buffer protocol (remote framebuffer) to remotely control another computer. It transmits the keyboard and mouse events from one computer to another, relaying the graphical screen updates back in the other direction, over a network.

VNC has problems, and can severely stress the systems that it runs on, so in general, you should prefer to use alternatives (documented below). You should only run VNC on the compute servers.

Usage

OS and Processor Invocation Version(s)
Red Hat Linux (64-bit) % /util/bin/vncviewer 4.1.3 (default)

Configuration

To run VNC, you first need to set up a VNC session on the Unix side.. To do this:

  1. Log on to the unix machine (using SSH, for example)
  2. Run "vncserver" on on this unix machine.
    • If you have never run VNC before, it will ask you to set a password for your desktop. Set one, then run "vncserver" again.

    VNC Server will set up a new 'X' desktop. You'll see something like this:

    
    yeager {~} > vncserver
    
    New 'X' desktop is yeager.cse.Buffalo.EDU:24
    
    Starting applications specified in /u0/csestaff/nina/.vnc/xstartup
    Log file is /u0/csestaff/nina/.vnc/yeager.cse.Buffalo.EDU:24.log
    
    yeager {~} > 
    
    

Now, you can connect to the X desktop with "vncviewer" on another computer (such as your PC). When you run vncviewer on a PC, it will ask you for a "VNC server:". This is "yeager.cse.buffalo.edu:24" in the example above. You should use the name and desktop number that VNC gives you. Click "OK", and it will ask you for a password... the password you set in step 2 above.

You should now get a window on your PC that contains an X Windows desktop that is running on the remote machine.

You can also connect to the VNC Server with a web browser that supports Java. The address is:


http://MACHINENAME:58nn/

... where MACHINENAME is the name of the computer you are running your VNC Server, and "nn" is the number of your desktop. For the VNC Server I started above, the URL is:


http://yeager.cse.buffalo.edu:5824/

When you are done with your VNC session, you should log in to the unix machine where you started it, and kill it with the command:

vncserver -kill :nn

If you do not kill the session, it will stay there forever.

You should only have one VNC Server running. To check your VNC Server processes, use the command:


% sps

For example, I can check my VNC processes on yeager, by running the following command on yeager:


yeager {~} > sps
Tty     User     Proc# Command
        nina      4785 tcsh -c xterm -T yeager -n yeager
         |        4789 xterm
 pts/59   *       4790 -csh
 pts/59    *     14117 sps
 pts/59 nina     13508 Xvnc :24 -desktop X -httpd /util/X11/lib/vnc/classes -auth
 pts/59 nina     13513 xterm
pts/146  *       13515 -tcsh
 pts/59 nina     13514 twm
734 (4183200k) processes, 4 (84664k) busy, 720 (2307312k) loaded, 0 (0k) swapped

From this, I can see that I have a VNC process, ":24". I can kill it with:


yeager {~} > vncserver -kill :24

Killing Xvnc process ID 13508

yeager {~} >

Notes

  1. VNC has some severe limitations that cause problems when it is not used properly. Much more robust methods of using X based clients from a personal machine are available and we strongly encourage you to use those instead if at all possible. UBIT provides the X-Win32 package for Windows platforms. For MacOS-X there is X11. Linux machines have native X-Windows support so there is no need for an extra package.
  2. To send a CTRL-ALT-DELETE signal without logging out of your host machine, position the cursor within the VNC window, hit F8, select Send Ctrl-Alt-Del.

References

  1. http://en.wikipedia.org/wiki/Virtual_Network_Computing
  2. http://www.realvnc.com/
  3. http://www.buffalo.edu/ubit/service-guides/software/downloading/windows-...
  4. http://www.opensource.apple.com/source/X11/