VNC Server Configuration in CentOS-5/6



############VNC Server Configuration in CentOS-5/6################
VNC ( Virtual Network Computing) server is  used to connect remotely to a computer system. This allows a user to see and control one computer from multiple locations. Because this control is transmitted over the Internet, the computer can be viewed from anywhere in the world.
VNC  is fairly uncomplicated and easy to use. Many operating systems, including Linux, Windows, already include simple VNC programs. These applications allow users to connect remotely and operate another computer loaded with the same software.
VNCs allow computers to become remotely sharable. This means that several different users, each in separate locations, can view a computer desktop at the same time. VNC software makes training, monitoring and troubleshooting easy by making remote access flexible.

Package Name - vnc-server
Config File -  /etc/sysconfig/vncservers
Daemon  - vncserver
Downloadà TightVNC tool for remote connection
Port no – 5801,5802,5901,5902,6001,6002
# netstat -tunlp | grep vnc   {To check VNC Server port no }

Install VNC Package for CentOS-5.x
[root@localhost ~]#  yum install vnc-server
 
Install VNC Package for CentOS-6.x
[root@localhost ~]#yum -y install tigervnc-server vnc-server

[root@localhost ~]#  useradd shahzad
[root@localhost ~]#  passwd shahzad
[root@localhost ~]# vi  /etc/sysconfig/vncservers
 

[root@localhost ~]#  vncpasswd
[root@localhost ~]#  vim /root/.vnc/xstartup
#####Uncomment both below line for full gnome windows.


To Enable remote connection in user profile 
[root@localhost ~]#vino-preferences
Or,
Go to, Application => Preference => Remote Desktop Connection .
[root@localhost ~]#su – shahzad
[shahzad@localhost ~]$vncpasswd
[shahzad@localhost ~]$vim /home/shahzad/.vnc/xstartup
unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc
Now Exit from user & restart vnc service.
[root@localhost ~]#  /etc/init.d/vncserver restart


[root@localhost ~]#chkconfig vncserver on
Kill VNC Server Process when got below error
 
 
[root@localhost ~]#vncserver –kill :2
To take system on remote through TightVNC
Syntx : --IPAddress of Server : Display number
Open TightVNC à192.168.0.62:2            {For Root Account}
Open TightVNC à192.168.0.62:3            {For User Account}