First, install VNC
By default, CentOS 6.4 is not installed.
Check whether the installation, enter:
[Root @ localhost ~] # rpm -q vnc vnc-server
package vnc is not installed
Tip is not installed, then start the installation, enter:
[Root @ localhost ~] # yum install vnc vnc-server
Second, set the VNC password
After installation is complete early start VNC otherwise need to perform the first step will be reported Centos still not installed VNC
[Root @ localhost ~] $ vncserver
Set VNC password, enter 🙁 in a user enter the login user is under it, if su imiss switch to imiss user input vncserver is started is another desktop also have to set a password, after the start of vncserver under the account login you need the password for this user set under a.)
At this point you will be prompted to enter a password, because it is the first time configuration. Re-enter twice.
[Root @ localhost ~] $ vncpasswd
Third, configure desktop type
[Root @ localhost ~] $ vi ~ / .vnc / xstartup
Under normal circumstances, we use Linux desktops are “Gnome” desktop, so the desktop is configured to compare this habit.
Press the “i” key to enter the edit mode, the main change the last two lines. Read:
# Xterm -geometry 80×24 + 10 + 10 -ls -title “$ VNCDESKTOP Desktop” &
# Twm &
Key edit the last two lines, the two lines uncommented get:
Fourth, configure the login account, desktop resolution, connection
[Root @ localhost ~] # vi / etc / sysconfig / vncservers
Modify the last two lines
VNCSERVERS = “1: root”
VNCSERVERARGS  = “- geometry 1024×768”
Fifth, configure the firewall to allow VNC connections
VNC server listening port from the beginning of 5900, display: 5901 1 monitor, display: 2 monitor 5902, and so on. CentOS firewall default is not allowed to connect to these ports, so you need to use the following steps to open the firewall (requires root privileges):
[Root @ localhost ~] # vi / etc / sysconfig / iptables
Above, we just added a root account and desktop 1, so here follow the above rules, add a “5901” port number.
-A INPUT -m state –state NEW -m tcp -p tcp –dport 5901 -j ACCEPT
Sixth, reboot the firewall
service iptables restart
Seven, set to start automatically VNC
[Root @ localhost ~] # chkconfig vncserver on
vncserver -kill: 1 (note that there is a space behind kill)
Nine, the client installation
Download and install vnc viewer
After a successful installation Login
Then it will pop up a password, the password you just set password.
Password not login account password set but vnc