Confugure VNC in Linux


(1) Run following commands to install VNC in linux.

yum install vnc-server

(2) Run following command to set password for the V NC connection.

vncpasswd
(3) Edit /etc/sysconfig/vncservers, and add the following to the end of the file.

VNCSERVERS="2:root"
VNCSERVERARGS[2]="-geometry 800x600 "
(4) Now restart Vnc service giving following command.

/etc/init.d/vncserver restart

Ex;
[root@saplinux ~]# /etc/init.d/vncserver restart
shutting down VNC server: 2:root [FAILED]
Starting VNC server: 2:root xauth: creating new authority file /ro ot/.Xauthority
New 'saplinux:2 (root)' desktop is saplinux:2
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/saplinux:2.log
[ OK ]

(5) Now open /root/.vnc/xstartup file and uncomment followi ng two lines.

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
(6) Then restart VNC service and then check from the windows PC through VNC viewer.

/etc/init.d/vncserver restart

(7) To check from the vnc viewer you will have to give VNC server's IP and then :2.

ex: 192.168.1.2:2



It will ask you for the password, you can give password which was assigned throgh vncpasswd command.