Google Site SearchFN Site Search FN Blog Login FN Blog Login
Site Navigation:


by Matthew Nicholson on February 9, 2004

Ever use VNC on a Windows Pc? It, just like Microsoft's Remote Desktop, allows you to control your desktop remotely inside you LAN, or across the internet. I have used these pieces of remote access software for quite sometime now under Windows and have found it to be extremely valuable. But, this is all on Windows, what about on Linux? VNC, while cross platform compatible, does differ from OS to OS. Since, Linux/Unix uses the X-Windowing system (XFree86), VNC functionality differs from that of a Windows PC. Normally, when VNC is run as a server on a Linux/Unix box, it spawns an X display (X:1, or X:2, etc) and when you connect to that sever you get that newly spawned X display, which is normally just a bare X desktop. If you want to get to your "local" desktop (X:0), you can try to specify which display to run the VNC server on, but, it will spit an error at you, telling you that an X server is already running on the display. This has always been the problem with VNC on Linux for me.

Enter xf4vnc. 

What is xf4vnc? To quote the homepage (

    "xf4vnc provides two implementations of VNC in an Xserver. Yet both implementations are built around XFree86(tm) 4.x which provides     numerous new extensions, such as RENDER and GLX.

The first, is to mimic the older 'Xvnc' virtual Xserver that exists in many other VNC implementations. This mode should be a drop in replacement for existing installations.

The second, is to manage the local Xserver display a.k.a :0. This mode allows you to export you local video card's display to a remote vncviewer using the XFree86 module ''. "

Now, what does all of this mean? Basically, xf4vnc is a version of VNC,  which comes with a module for XFree86 which allows you finally get to that X:0 display by remote (And there for, seeming just like a Windows impementation).

Downloading and Installing xf4vnc

First off, it is best to have VNC and VNC-server already installed, which you can learn about doing here.

Unfortunately, there are no RPMs for xf4vnc available (not that I have found at least). Fortunately, the install requires no compilation, is very simple, fast, and is scripted to prompt you for information as needed. 

First off, go to the homepage ( and follow the links to the Sourceforge download mirrors to download the package.

Once it is downloaded:

$ cd /tmp/xfvnc/
$ tar -xzvf  xf4vnc-ix86-linux-
$ cd xf4vnc-ix86-linux-

Now, to install, you must be root:

$ su
$ ./

This will run the installer script, which will explain what is is installing, then ask you to press any key to continue, followed by prompting you (answer 'y' or 'n', the default answer is 'n' and entering anything other than 'y' will be accepted as an 'n'):

Do you want to install the module for XFreee86?

This is what allows you to VNC to your X:0 display, you want this.

Do you want to install 'Xvnc'?

Do you want to install xf4vnc's unique modular vncviewer?

Since you already have VNC installed, it is not imperative that you install these, but, it does not hurt anything. I recommend saying 'y'

Now everything is installed, but we are not done yet...


When the installer script installs the module for XFree86, it also writes a new XF86Confg file for you , located: /root/XF86Config/xf4vnc. This is meant to replace you current working XF86Config, but is not yet in place. To back up and replace your current XF86Config file:

As root still:

cd /etc/X11/
mv XF86Config XF86Config.bak
mv /root/XF86Config.xf4vnc /etc/X11/XF86Config

Now the config file is in place and VNC is almost ready to run on the X:0 display....

Set the VNC password via:


It will prompt you twice for the password needed to access vnc. 

Now, reboot/restart X. If everything is correct in the XF86Config file, you should really notice now difference in you display, other than the fact that VNC has now been started on you local display. This will be run on the standard VNC port, 5900, which of course, must be accessible through any firewall you might have if you wish to be able to use you wonderful new remote desktop.

After all of this, connecting to you desktop is the same as connection to any other VNC server, just:

vncviewer hostname

(if you leave out the display it will default to 0, or you can specify via hostname:0 if you wish)

and you will be prompted for the password for the system. After that you should connect and see you local X display.