What is VNC?
VNC stands for Virtual Network Computing, and it was developed at the Olivetti & Oracle Research Laboratory (Cambridge, England) in 1994. Originally running on an ATM-connected thin client device, it was ported to other platforms, including Win32, Unix, GNU/Linux, and Mac OS. It is a remote display system which allows a thin client to remotely access a desktop GUI environment on another computer over the network.
Since it is platform independent, you can remotely run an Apple desktop from a Windows client, or a Unix desktop from an Apple client, and so on. The thin client (called the VNC viewer) is small enough to fit on a floppy or run from a Java-enabled web browser. Other cool features include the ability to share a desktop session with more than one client, and the "stateless" nature of the VNC viewer.
What does this mean to a Linux/Unix administrator or power user? It means that you can run a GUI desktop on a remote machine, over a LAN or over the Internet. For a complete overview and complete documentation, see the Virtual Network Computing homepage .
The VNC Protocol
From the VNC homepage, a description of the VNC protocol:
The VNC protocol is a simple protocol for remote access to graphical user interfaces. It is based on the concept of a remote framebuffer RFB. In the past we have tended to refer to the VNC protocol as the RFB protocol, so you may have seen this term in other publications. The protocol simply allows a server to update the framebuffer displayed on a viewer. Because it works at the framebuffer level it is potentially applicable to all operating systems, windowing systems and applications. This includes X/Unix, Windows 3.1/95/NT and Macintosh, but might also include PDAs, and indeed any device with some form of communications link. The protocol will operate over any reliable transport such as TCP/IP.
![]()
This is truly a "thin-client" protocol: it has been designed to make very few requirements of the viewer. In this way, clients can run on the widest range of hardware, and the task of implementing a client is made as simple as possible.
What is TightVNC?
TightVNC is an enhanced version of VNC. It includes better compression algorithms for improved performance over WAN links, as well as new features like automatic SSH tunneling between Unix/Linux hosts. For a complete list of enhancements and complete documentation, see Constantin Kaplinsky's TightVNC homepage.SSH, or the Secure Shell, is the "Swiss Army knife" of host-to-host networking. It allows secure (encrypted and authenticated) connections between any two devices running SSH. These connections may include terminal (CLI) sessions, file transfers, TCP port forwarding, or X Window System forwarding. SSH supports a wide variety of encryption algorithms, including AES-256 and 3DES. It supports various MAC algorithms, and it can use public-key cryptography for authentication or the traditional username/password. The good news is that SSH does not cost anything on the client or server side, although there are some nice SSH packages for MS Windows that require you to purchase commercial licenses.
What is SSH?
For more info on SSH, check out the official OpenSSH website .
| Package Description |
Click Link to Download |
| TightVNC Server RPM Package (x86) |
tightvnc-server-1.2.8-1.i386.rpm
|
| TightVNC Viewer RPM Package (x86) |
tightvnc-1.2.8-1.i386.rpm |
| TightVNC
Viewer for Windows (No installation necessary, just unzip and run.) |
tightvnc-1.2.8_x86_viewer.zip |
Screenshot of
TightVNC over SSH session from LAPTOP to RAT over LAN-2 forces SSH version 2
-c aes128-cbc specifies a fast, strong cipher (better than 3DES)
-x makes sure that X over SSH forwarding is disabled for this SSH connection
-p specifies the non-standard TCP port number for the SSH server
-l specifies a different username on the remote end than the client on the local end
-f -L %L:%H:%R %G sleep 20 are defaults from the vncviewer manpage
-Tight encoding includes several types of compression.
-via invokes SSH using the $VNC_VIA_CMD environment variable
-depth 8 calls for 8-bit color, it improves the look of GUI detail at high JPEG compression rates
-quality 1 (very high JPEG compression of some portions of the screen. Only 0 is higher)
Screenshot of TightVNC over SSH session
from LAPTOP to LAB over WAN# For Tight VNC to LAB
VNC_VIA_CMD='/usr/bin/ssh -2 -c aes128-cbc -x -p 8400 -l vanimal -f -L %L:%H:%R %G sleep 20'
export VNC_VIA_CMD
#!/bin/sh
# Red Hat Linux VNC session startup script
#exec /etc/X11/xinit/xinitrc
exec mwm
Session from RAT
(running WindowMaker) to LAB (running Gnome) over WAN
Session from Windows XP to a VNC server on RAT.
Screenshot of PuTTY port
forwarding setup for TightVNC over SSH| Scenario
|
Avg.
BW Util. (bi-directional) |
Packets
Per Sec. (bi-directional) |
Avg.
Packet Size |
Comments |
| LAN with
Hextile encoding, Depth 16 1024x768 (1) |
1485 Kbps |
229 pps |
811 bytes |
Fast and responsive |
| LAN with
Tight encoding, Depth 16, Quality 6 1024x768 (1) |
474 Kbps |
118 pps |
504 bytes |
Fast and responsive |
| LAN with
Tight encoding, Depth 8, Quality 1 (2) |
246 Kbps |
88 pps |
349 bytes |
Fast and responsive |
| LAN with
Tight encoding above, Gedit session (3) |
61 Kbps |
43 pps |
178 bytes |
Fast and responsive |
| WAN with
Tight encoding, Depth 8, Quality 1 (LAB) (4) |
42 Kbps |
11 pps |
490 bytes |
Usable, but noticeable delay |
| WAN with
Tight encoding, Depth 8, Quality 1 (HOUSE) (4) |
66 Kbps |
15 pps |
553 bytes |
Usable, but noticeable delay |
| WAN with
Tight encoding above, Gedit session (HOUSE) (5) |
18 Kbps |
11 pps |
210 bytes |
Usable, but irksome delays |
Notes:
The TightVNC server desktop used was Gnome in all cases. SSH2 with AES128-CBC was the transport mechanism for the VNC traffic. Unless otherwise noted, desktop size was 800x600 pixels. The test consisted of the following: Opening iagno, moving the window left and right, then letting the server play the game against itself. Then, a terminal window was opened and the top utility was executed. Top was then stopped and xdaliclock -24 -cycle was started. The xdaliclock window was then moved all around the screen and closed. After that, kasteroids was selected from the game menu and played. The game was then closed. Traffic stats were gathered by Ethereal.
(1) Session was so responsive, it was hard to tell that it was occurring over a network. Kasteroids was completely playable. The only negative comment I have is that moving windows around the desktop spiked RAT's CPU utilization as high as 100%! Scrolling windows, resizing windows, and moving windows seems to be very CPU intensive on the Xvnc server side of things.
(2) Session very responsive. 8-bit color looks fine for any administrative duties. Same CPU utilization issue as in note (1).
(3) Gedit was perfectly usable, no noticeable delays.
(4) Although the delay/lag was noticeable, the desktop and apps were usable. Kasteroids was not playable, though.
(5) Gedit was doable, but the delay between pressing a key or moving the cursor and seeing the result was annoying. A straight SSH session in text mode is more responsive and uses less bandwidth.
Note: Even though it only listens on the loopback, a local GUI user on your server can still connect without SSH to 127.0.0.1 and bring up a session. That is one reason why you may want to restrict the vncviewer software as detailed later in this section. Also, another user on the system can tunnel a VNC session over SSH from a remote host and connect to your session. In this scenario, only your VNC password prevents entry.
WAN
Server: vncserver :64 -depth 8 -geometry 800x600 -name LAB -mysql -nevershared -dontdisconnect
Viewer: vncviewer -encodings Tight -depth 8 -quality 1 -via 8.4.33.4 mysql:64
LAN
Server: vncserver :64 -depth 16 -geometry 1024x768 -name RAT -mysql -nevershared -dontdisconnect
Viewer: vncviewer -encodings Hextile -depth 16 -via 192.168.1.2 mysql:64
- or -
Viewer: vncviewer -depth 16 -via 192.168.1.2 mysql:64 (This will use Tight encoding with default quality and compression)
Don't forget to set up your $VNC_VIA_CMD environment variable as necessary!