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 .
For GNOME:
# 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: centos.crazyfrogs.org * epel: be.mirror.eurid.eu * extras: centos.crazyfrogs.org * updates: centos.crazyfrogs.org 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 Password: Verify:
Configure VNC configuration for new user
Edit /etc/sysconfig/vncservers file and add the user name:
VNCSERVERS="2:pirat9"
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.
Enter the password and you will able to connect to your server.