VNC Tutorial
In this VNC Tutorial I'll show you how to set up and
use the free VNC software that comes preinstalled with RedHat Linux.
VNC is a fantastic piece of software that allows you to log into a remote
server as if you were on its console, which is very handy if you're tired
of command-line interfaces.
Similar to Windows Remote Desktop, you will use the VNC Viewer to open
up a window which allows you to manage the remote server through its GUI
interface.
VNC Installation Check
Check whether your version of Unix comes preinstalled with VNC.
To check : (on Linux)
$rpm -q vnc vnc-4.0-11.el4
This means it is already installed on my server.
VNC Download
You can download the Free VNC edition from Real VNC.You will need the vnc server on your linux server and the vnc client on your own laptop/desktop client.
VNC Installation
Presuming you know how to install windows software for the VNC Client, I'll discuss installing the VNC Server on Linux.
Download the relevant VNC server version for your platform, in this case we're downloading vnc-4_1_2-x86_linux.tar.gz.
Place it anywhere on your server where you keep your downloaded software.
For small software packages like this, I download it to my PC and then use software like WinSCP to get it across to my linux server.
If you are using FTP , remember to set it to 'binary' mode.
I've put it in /tmp.
Now unzip and untar the file (make sure you are ROOT ! ),
then cd to the unpacked directory and run vncinstall with your bin directory
as a parameter :
[root@testserver tmp]# gunzip vnc-4_1_2-x86_linux.tar.gz [root@testserver tmp]# tar -xvf vnc-4_1_2-x86_linux.tar vnc-4_1_2-x86_linux/ vnc-4_1_2-x86_linux/README vnc-4_1_2-x86_linux/vncinstall vnc-4_1_2-x86_linux/LICENCE.txt vnc-4_1_2-x86_linux/vnc.so vnc-4_1_2-x86_linux/vncviewer vnc-4_1_2-x86_linux/vncpasswd vnc-4_1_2-x86_linux/vncconfig vnc-4_1_2-x86_linux/x0vncserver vnc-4_1_2-x86_linux/Xvnc vnc-4_1_2-x86_linux/vncviewer.man vnc-4_1_2-x86_linux/vncpasswd.man vnc-4_1_2-x86_linux/vncconfig.man vnc-4_1_2-x86_linux/x0vncserver.man vnc-4_1_2-x86_linux/Xvnc.man vnc-4_1_2-x86_linux/vncserver vnc-4_1_2-x86_linux/vncserver.man vnc-4_1_2-x86_linux/java/ vnc-4_1_2-x86_linux/java/index.vnc vnc-4_1_2-x86_linux/java/vncviewer.jar vnc-4_1_2-x86_linux/java/logo150x150.gif [root@testserver tmp]# cd vnc-4_1_2-x86_linux [root@testserver vnc-4_1_2-x86_linux]# ./vncinstall /usr/bin Copying Xvnc to /usr/bin Copying Xvnc.man to /usr/share/man/man1/Xvnc.1 Copying vncviewer to /usr/bin Copying vncviewer.man to /usr/share/man/man1/vncviewer.1 Copying vncpasswd to /usr/bin Copying vncpasswd.man to /usr/share/man/man1/vncpasswd.1 Copying vncconfig to /usr/bin Copying vncconfig.man to /usr/share/man/man1/vncconfig.1 Copying vncserver to /usr/bin Copying vncserver.man to /usr/share/man/man1/vncserver.1 Copying x0vncserver to /usr/bin Copying x0vncserver.man to /usr/share/man/man1/x0vncserver.1
Making your VNC viewer more user-friendly
Edit file: $HOME/.vnc/xstartup and remove the comments in front of these 2 lines:
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
Start the VNC Server
You only need to type in 'vncserver' to get the vnc service running, you will be asked to set the VNC root password (not shown):[root@testserver ~]# vncserver New 'testserver.domain.com:1 (root)' desktop is testserver.domain.com:1 Starting applications specified in /root/.vnc/xstartup Log file is /root/.vnc/testserver.domain.com:1.log
To connect to it , use the VNC Client software on your desktop to start
the VNC Viewer.
You will get a little window which allows you to specify which VNC server to connect to.

Then you must supply the VNC password:

Now you have access to the server via the VNC display
:

Stop the VNC Server
Lastly , use this command to stop the VNC service (sometimes this process runs away and uses up too much CPU..)
It is also a security risk, so it is a good idea to run it only when
you need a VNC Connection, so only start it when you need it (you can
start it via a remote terminal/SSH/Putty session) and shut it down again
when you have finished the task you needed it for.
[root@testserver ~]# vncserver -kill :1 Killing Xvnc process ID 550
For more documentation, read the Online
VNC Documentation


