RealVNC, Windows, Linux tutorial.

Written by Tom on Tuesday 27/03/07

Virtual Network Computing (VNC) is a desktop protocol to remotely control another computer. It transmits the keyboard presses and mouse clicks from one computer to another relaying the screen updates back in the other direction, over a network.

With our new satellite connection I had to physically shift the Linux (firewall, content filtering) box to the other end of the campus. This is where realVNC comes into its own.


Download the latest version of realVNC from here.

Follow these excellent instructions from JustLinux for Linux and Windows installation.


On XP after the installation I was prompted with the Options dialogue and clicked on the Configure button to set the password for the PC I was on. Then I was prompted by the XP firewall to unblock realVNC clicking OK I was done, no more setup required for the XP box.

RadHat 9.

After the installation of the rpm, I typed "vncserver" and was prompted to enter a password for this user. By typing "vncserver :1" it forces vnc to use the screen number of 1 therefore the port that it will use is 5900 + 1 = 5901. You need to know this number to enable this port by editing /etc/rc.d/rc.firewall-2.4. I added the following lines to rc.firewall-2.4.

This enables realVNC desktop application.

$IPTABLES -A INPUT -p tcp -m tcp --dport 5901 --tcp-flags SYN,RST,ACK SYN -j ACCEPT

This enables realVNC java applet for your browser.

$IPTABLES -A INPUT -p tcp -m tcp --dport 5801 --tcp-flags SYN,RST,ACK SYN -j ACCEPT

The default desktop for the VNC Server is "TWM",
though most people are used to KDE or Gnome instead. Here is how to change it:

Edit ~/.vnc/xstartup (note that .vnc is a hidden file, usually found in /home/’user’/.vnc)

For KDE, replace "twm &" with "startkde &"

For Gnome, replace "twm &" with "exec gnome-session &"

Kill any existing VNC servers with "vncserver -kill :xxx" where xxx is the display number.
Start a new server.

To view another desktop fire up the VNC viewer. When prompted for the Server name I found it easiest to enter the IP address, there are two ways you can do this.

1) IP address:1 where 1 screen number (single colon)

2) IP: address::5901 where this is port number + screen number. (double colon)

All should be well if not here is a site with lots of help.