Install VNC Server On CentOS 6.4

Install VNC Server On CentOS 6.4

In this handy tutorial, let me show you how to install vncserver on Centos 6.4 and how to  connect to this server from remote hosts.

Install Desktop Environment

Sometimes you may need the GUI to do some tasks in Linux even if that tasks are not preferred for Unix administrations .


# yum groupinstall  "General Purpose Desktop" "Desktop Platform"

 For KDE:

# yum groupinstall  "KDE Desktop"

Install VNC server

# yum -y install vnc-server
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* base:
* epel:
* extras:
* updates:
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package tigervnc-server-module.i686 0:1.1.0-5.el6_4.1 will be installed
--> Finished Dependency Resolution

Install   Tigervnc-Server

# yum install tigervnc-server

Make vnc password for user (Ex. pirat9). Login to the user and run the following command:

$ vncpasswd

Configure VNC configuration for new user

Edit /etc/sysconfig/vncservers file and add the user name:


you can add more users with multiple different display size for every user.

VNCSERVERS="2:userx 3:usery 4:userz"
VNCSERVERARGS[2]="-geometry 1280x1024"
VNCSERVERARGS[3]="-geometry 1280x1024"
VNCSERVERARGS[4]="-geometry 800x600"

Make it to start automatically on every reboot and start the vnc service.

# chkconfig vncserver on
# /etc/init.d/vncserver start
Starting VNC server: 2:pirat9 xauth: creating new authority file /home/pirat9/.Xauthority
xauth: (stdin):1: bad display name "unixmen-Centos64:2" in "add" command
New 'unixmen-Centos64:2 (pirat9)' desktop is unixmen-Centos64:2
Creating default startup script /home/pirat9/.vnc/xstartup
Starting applications specified in /home/pirat9/.vnc/xstartup
Log file is /home/pirat9/.vnc/unixmen-Centos64:2.log [ OK ]

Download and install VNC viewer in your client systems and try to  connect to  your vnc server.

vncccEnter the password and you will able to connect to your server.


  • Guest

    You should NEVER do this on a machine reachable from the internet! The VNC-protocol can be easily intercepted and authentication with ONLY a password is MUCH TOO WEAK! Your setup is HORRIBLY INSECURE!


    To be scure, allow only VNC connections from “localhost” AND then tunnel the VNC connection securely through SSH!

  • Mohamed


  • Bob

    Hi Mohammed,

    Tip for future tutorials,

    Please test this on a virtual box first with a CentOS install with minimum setup.
    I’ve tried this on one of those sets as a test, and i’m unable to get it running with your instructions. The setup is fully installed however when you connect with VNC you get a checkbox with

    – Accept clipboard from viewers
    – Send clipboard to viewers
    – Send primary selection to viewers

    And the rest of the screen is black without buttons. This is due to missing some packages or missing references, i’ll have a look and post an extra comment with them.

  • Bob

    Mel Kahm (I thought for some reason the poster below was the author, my bad),

    First, adjust your ~/.vnc/xstartup according to

    Second, for some awkward reason this isn’t installed? (on minimum install + yum groupinstall “General Purpose Desktop” “Desktop Platform”)
    # yum install gnome-panel

    Then it runs works according your tutorial :-)

  • Pingback: Installare Vnc e Gnome Desktop su CentOS6.5 | ObondO Labs()