dcsimg

What is VNC?

VNC is short for Virtual Network Computing. First developed by Olivetti Research Laboratory (now called AT&T Laboratories Cambridge), VNC was originally designed to create and manage virtual network computers that could be added or deleted at will. However, what VNC turned into was a remote display system most similar to PC-Anywhere, the remote access application.

VNC is short for Virtual Network Computing. First developed by Olivetti Research Laboratory (now called AT&T Laboratories Cambridge), VNC was originally designed to create and manage virtual network computers that could be added or deleted at will. However, what VNC turned into was a remote display system most similar to PC-Anywhere, the remote access application.

VNC has all of the benefits of PC-Anywhere, but is superior because it’s platform independent. VNC software runs on almost all modern operating systems, including Unix, Linux, Mac OS X, and Windows — even Windows CE. Better yet, VNC for Linux can interoperate with VNC on all other platforms and vice versa. With VNC, you can access virtually any desktop from any other desktop.

For example, if you have a Linux laptop for travel and want to access your Windows machine at home, the Linux VNC client can connect with the Windows VNC server and display the Windows desktop on your laptop. You can then use your Windows system just like you do when you’re sitting in front of your monitor at home.

System managers find VNC invaluable for help desks and remote access. If someone needs support, an IT manager simply connects to the user’s machine directly and fixes the problem in front of the user’s eyes! Some consultants run VNC on their notebook when visiting a client site. They carry a floppy disk with the VNC viewer to access their machine from anywhere in the building. And if you have a home network, VNC is indispensable. Does your daughter have a problem on her Windows box? No problem! Use the viewer to attach to her display and fix her machine directly without having to run all over the house (or run home from the office).

VNC is easy to install on Linux. Let’s use the AT&T version of VNC as our example. (A number of VNC packages are available, many with unique features. The sidebar “VNC Versions” lists some of the variants. Choose the one that best suits your needs.)

1. To begin, download the latest VNC package from http://www.uk.research.att.com/vnc/download.html. As of early January 2003, the latest version is 3.3.6.

2. Unpack the gzip-ed tar package with:


% gunzip < vnc-3.3.3r2_x86_linux_2.0.tgz \ | tar xf —

3. Go to the vnc_x86_linux_2.0 directory and install the VNC applications into /usr/local/bin. If you don’t have superuser privileges, you can install the VNC utilities in your personal ~/bin directory instead.


# cp vncviewer vncserver vncpasswd \ vncconnect Xvnc /usr/local/bin
# chmod u+x /usr/local/bin/*vnc*

4. If you plan on using the Java VNC viewer, install the VNC Java classes. The default directory for the classes is /usr/local/vnc/classes, but you can install them anywhere, including your own home directory.


# mkdir /usr/local/vnc
# mv classes /usr/local/vnc

5. Finally, check the vncserver script (found in the bin directory from above) and verify that the path to Perl is set correctly and that $vncClasses is set to the directory where you installed the VNC Java classes.

Once completed, you should be able to start the VNC server with vncserver. If successful, you should see a message similar to:


New ‘X’ desktop is wado:1

Starting applications specified in /home/mascio/.vnc/xstartup
Log file is /home/mascio/.vnc/wado:1.log

The first time you start vncserver, it prompts you to set a connection password. This password allows a connection to your server. Choose a good password. This password is not a part of the normal Linux system access controls. The password is stored, encrypted, in ~/.vnc/passwd. The log file, named something like ~/.vnc/wado:1.log, is useful in diagnosing any startup problems.

In our example above, the server is now running on screen 1. This translates to TCP/IP port 5901 (base 5900 + screen number 1). Generally, you don’t have to worry about the exact number, unless you have to change the installation to have VNC run on a higher set of ports. In addition, there is an HTTP port at 5801 (HTTP base 5800 + screen number 1). If you have a different number, your TCP/IP and HTTP values will change accordingly.

Now that the server is running, go to a second machine with X running and enter the command vncviewer wado:1. The client will ask for your VNC server’s password. Once authenticated, the remote desktop will appear on your desktop.

By default, the VNC server allows only one client connection at a time. If you try to access the VNC server from a third machine, all other viewers (remember, viewers are the clients) are disconnected. However, if you use the –shared flag, you can share the server with any existing connections. All of the shared connections see the same thing and can control the mouse and keyboard.

If you use VNC in this mode, (say, for presentations), you may want to add the –viewonly option to allow a shared view-only session, which prevents others from taking control of the server while you’re presenting.

Finally, to stop the server, use the command vncserver –kill :1.

We mentioned the HTTP connection, but haven’t yet done anything with it. You can use the HTTP connection to connect to the VNC server from any Java-enabled Web browser. To access the HTTP connection, enter the URL (in this case) http://wado:5801/. Again, the server prompts you for the VNC server password, and if you authenticate, you will now have the remote desktop in the browser window. The Options button at the top of the screen lets you configure shared and view only sessions.

If you have any problems, consult the README file or the FAQ at http://www.uk.research.att.com/vnc/faq.html.




VNC Versions



John R. S. Mascio is a systems and network manager. He can be reached at mascio@ryu.com.

Fatal error: Call to undefined function aa_author_bios() in /opt/apache/dms/b2b/linux-mag.com/site/www/htdocs/wp-content/themes/linuxmag/single.php on line 62