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.
What is xf4vnc? To quote the homepage (http://xf4vnc.sourceforge.net/):
"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 'vnc.so'. "
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 (http://xf4vnc.sourceforge.net/) 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-188.8.131.52.tar.gz $ cd xf4vnc-ix86-linux-184.108.40.206/
Now, to install, you must be root:
$ su $ ./install.sh
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 vnc.so 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 vnc.so 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:
(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.