Search

 

Here you can search and view our site Knowledge Base.
To find a specific article, use KB-article number format (ex. KB-1)

Article number: Article number: kb-25
Q. How to install VNC on CentOS?

A. Installation VNC on CentOS 6.5

This guide explains how to configure VNC-server in CentOS 6.5 server. It is a very convinient way of administrating the CentOS 6.5 with the help of GUI(Graphics User Interface). The GUI can be access any where with the help of the VNC-client on any OS. The basic condition is that the connecting OS must have VNC-clients installed in it.

Installation
We must log in the system with root, & now we will be install the VNC-server.

# yum groupinstall Desktop

Further install

# yum install gnome-core xfce4 firefox
# yum install tigervnc-server

Now make the service on after every reboot

# chkconfig vncserver on

Adding VNC user
We will use user=myuser it will differ in your case. You can use any username for the same.

# useradd myuser

Now we will assign the vncpassword for the user with the user we just created before as:

# su - myuser
# vncpasswd

[root@server1 ~] # su - myuser
[myuser@server1 ~]$ vncpasswd
Password:<--yourvncpassword
Verify:<--yourvncpassword
[myuser@server1 ~]$

Now I will make the configuration file for the vncserver by creating file as follows:

# vi /etc/sysconfig/vncservers

[...]
VNCSERVERS="1:myuser"
VNCSERVERARGS[1]="-geometry 800x600"

Here your port comes to be 5901 & 800x600 resolution for the VNC client, you can choose resolution of your own choice.

Now we will restart the VNC server service as root user:

# service vncserver restart

& Finally reboot the machine.

# reboot

Setup the iptables to accept the VNC connection

# sudo iptables -I INPUT 5 -m state --state NEW -m tcp -p tcp -m multiport --dports 5901:5903,6001:6003 -j ACCEPT
# sudo service iptables save
# sudo service iptables restart

This page has been viewed 528 times

Other questions in this category Other questions in this category
1. How to install OpenVZ Virtualization on CentOS 6 (viewed 4389 times)
2. How to install cPanel & WHM? (viewed 730 times)
3. How to Install-Uninstall Clam Antivirus? (viewed 701 times)
4. How to install wget command on CentOS? (viewed 669 times)
5. How to install Webmin on CentOS? (viewed 662 times)
6. How to enable and run MySQL/MariaDB on CentOS 7? (viewed 640 times)
7. How To Install cPanel on a Virtual Server Running Centos 6? (viewed 619 times)
8. How to Uninstall MySQL? (viewed 617 times)

Return to Search

Back to Top