Open source software security

VNC Computing with Linux

30 November -0001
by Justin
February 21, 2003

VNC (Virtual Network Computing) is a remote desktop application similar to PCAnywhere or Microsoft Terminal Services. Developed by AT&T, VNC allows you to access your Linux desktop from virtually anywhere. You can use either a client application or any Java enabled web browser to access a VNC server. VNC allows for all sorts of remote work and lets you get to your Linux desktop quickly and easily.

Installation

To start using VNC you have to install the VNC package from http://www.uk.research.att.com/vnc/. Download the latest tar.gz file to your home directory and unpack it. As of this writing vnc-3.3.6-x86_linux.tar.gz is the latest available. After you download the package unpack it with 'gunzip vnc-3.3.6-x86_linux.tar.gz', then 'tar -xvf vnc-3.3.6-x86_linux.tar'. This will create a new directory named vnc-3.3.6-x86_linux. 'cd' into that directory and install the program using the vncinstall script (after reading the README file of course) using './vncinstall'. This will put all the packages in the right place. You may have to move around some class files for the Java based viewer to work (this is detailed in the README). In my case I had to issue (from the vnc-3.3.6-x86_linux directory):

mkdir -p /usr/local/vnc/classes
cp classes/* /usr/local/vnc/classes

This puts all the right java class files into their appropriate directories. Once this is done you should be ready to go.

Running VNC

To start the VNC server you issue the 'vncserver' command. The first time you run the server you will have to specify a password. After that you should see something like:

New 'X' desktop is localhost:1

This tells you which desktop and port to use to connect. The default listening TCP/IP port for the VNC client program is 5901, the default for the HTTP viewer listens on TCP/IP 5901. If your desktop is 2, these ports will be 5902 and 5802 and so on. Be sure to open your firewall to allow these ports (you have to allow both to use the HTTP viewer).

Connecting to VNC Servers

To connect to your VNC server with a web browser, open one up and type in "http://www.hostname.com:5801" or use the IP ("http://192.168.0.2:5801", etc.). You should see a rather bland login screen that will prompt you for the appropriate password to connect to the VNC server:

VNC viewer

Enter the password, click the 'OK' button and wait patiently. Once you see the 'X' cursor you're connected. The default desktop for the VNC server is TWM, which, in my opinion is rather boring. You can use kde if you want (and you have it installed) by editing your .vnc/xstartup file. Simply change the 'twm' to 'kde' or whatever other window manager you want to use and you're good to go.

Alternatively you can connect to your VNC server using the vncviewer. If you're installed the VNC package the executable is located in the same place as the vncviewer. If you're on a Windows machine and you want to connect to your VNC server you have to download the Windows zip from the AT&T website and unzip it. Inside the zip you'll find a program called 'VNCviewer.exe. Simply double click that and when it asks for hostname type in your IP address or hostname and the desktop (for example 'localhost:1'). This will get you a spiffy desktop display:

VNCviewer.exe

Closing VNC

To stop the VNC server you can use 'vncserver -kill:1' to close up a specific desktop. To actually kill the server you'll have to do a 'ps -aux' and find the process number than issue a 'kill [number]' where [number] is the process number.

My Thoughts

Overall I think VNC is a great system. Unfortunately when you actually do a full KDE desktop display it gets really slow and sticky. Not only that but screen savers, etc. slow things down even more. In my opinion its best to use twm for basic tasks. Don't expect any sort of PCAnywhere speed from VNC. Its really nice for simple things but I think actually running a computer using VNC would be maddening. Best to just stick with SSH for now.