Skip to main content

How to install vnc on centos 6

VNC server

VNC is used to display X windows sessions on remote computers.In this tutorial, we can learn how to setup VNC server on centos 6. Desktop environment is required in order to enable VNC server on centos.

Install VNC on Centos 6

Before installing VNC server, make sure you have installed any Desktop environment.
Step 1 » Issue the below command to install gnome desktop environment.
[root@krizna ~]# yum groupinstall Desktop
Step 2 » After installing gnome packages .Issue the below command to install VNC package along with dependencies.
[root@krizna ~]# yum -y install tigervnc-server pixman pixman-devel libXfont
Step 3 » Create user name and password.
[root@krizna ~]# adduser user1
[root@krizna ~]# adduser user2
[root@krizna ~]# passwd user1
[root@krizna ~]# passwd user2

Step 4 » Create VNC passwords for the Users created.
[root@krizna ~]# su - user1
[user1@krizna ~]$ vncpasswd
[user1@krizna ~]$ logout
[root@krizna ~]# su - user2
[user2@krizna ~]$ vncpasswd
[user2@krizna ~]$ logout

Step 5 » Now open /etc/sysconfig/vncservers file and add the following lines at the end of the file( Edit as per your usernames ).
VNCSERVERS="1:user1 2:user2"
VNCSERVERARGS[1]="-geometry 640x480"
VNCSERVERARGS[2]="-geometry 800x600"

Here we have configured session 1 with 640×480 resolution for the user “user1” and session 2 with 800×600 resolution for the user “user2”.
Step 6 » Start vnc service
[root@krizna ~]# service vncserver start
and issue this command to start vnc service automatically during startup.
[root@krizna ~]# chkconfig --levels 235 vncsever on
Step 7 » Now in remote machine, start vncviewer type the IP and session as below to view their respective sessions. for user1 for user2

install vnc on centos 6
Users sessions.
install vnc server centos 6


» Check the iptables in the server, if you are not able to connect the sessions.
Issue the below command to stop iptables service.
[root@krizna ~]# service iptables stop
try again.
» you might receive the below error while starting the vnc service.
/usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
/usr/bin/Xvnc: symbol lookup error: /usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids

Issue the below command to install pixman,pixman-devel and libXfont packages.
[root@krizna ~]# yum -y pixman pixman-devel libXfont
This command will update everything .
[root@krizna ~]# yum update
and restart the VNC service and try again.

Good luck

  • deepa rajesh

    How to access windows service from centos using cmd line Net command ?