In this tutorial, we will show you how to install VNC Server on CentOS 6. For those of you who didn’t know, VNC (Virtual Network Computing) server is free and open-source software that is designed for allowing remote access to the Desktop Environment of the server to the VNC Client whereas the VNC viewer is used on the remote computer to connect to the server. To use VNC you must have a TCP/IP connection and a VNC viewer client to connect to a computer running the VNC server component. The server transmits a duplicate display of a remote computer to the viewer.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you the step-by-step installation VNC server on CentOS 6.
- A server running one of the following operating systems: CentOS 6.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
non-root sudo useror access to the
root user. We recommend acting as a
non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.
Install VNC Server on CentOS 6
Step 1. First, you need to update the system to ensure that we have all of the latest software installed.
Step 2. Install the required packages.
yum groupinstall Desktop yum install tigervnc-server yum install xorg-x11-fonts-Type1 yum install vnc
Step 2. Enabling VNC Server service.
service vncserver start chkconfig vncserver on
Step 4. Create a VNC password for the user.
Step 5. Configure VNC server.
Add the following to the end of the file:
VNCSERVERS="1:idroot" VNCSERVERARGS="-geometry 1024x600"
Step 6. Configure firewall rules to allow the VNC connection.
iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 5801 -j ACCEPT iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 6001 -j ACCEPT service iptables save service iptables restart
Step 7. Setting Gnome session VNC.
Restart VNC service.
service vncserver restart
Now kill the VNC Server:
vncserver -kill :1
Edit the xstartup file in .vnc directory:
Comment the last line and run the Gnome:
#twm & exec gnome-session &
Restart the service:
service vncserver restart
Now go to your Windows or Linux machine and download the VNC Viewer client and install it in your system to access the desktop. Now you can able to connect the VNC server using IP and Port ( Eg: 192.168.1.10:1) and you will be asked to enter the password, and enter the password that you have created earlier.
Congratulations! You have successfully installed the VNC. Thanks for using this tutorial for installing the VNC server on CentOS 6 system. For additional help or useful information, we recommend you check the official VNC website.