Environment: CentOS 6.4
1. Installation of tigervnc-server and related software
First check if the Tigervnc-server installation package is installed in the system
Rpm-qa Tigervnc-server
If not, install directly
Yum Install tigervnc-server*
2, modify the Vncserver configuration file, configure the user and resolution
Configuration file for Vncserver/etc/sysconfig/vncservers
Follow the last two lines of comments, corresponding to your own settings, add a new two lines
Vncservers= "2:test"
vncserverargs[2]= "-geometry 1024x768"
Vncservers= "2:test" in 2 represents Port 5902, which is accessed through the host ip:5902. Test is the user name of the system, which must exist in the host, and if it does not exist, create the user.
For example, your host IP is 192.168.1.10, then through the setup, using VNC client login 192.168.1.10:5902, is the login test user.
vncserverargs[2]= "-geometry 1024x768" is the setting of the screen resolution (which can be set according to your own screen resolution).
3. start the VNC Server service
Switch to administrator, restart service
Service Vncserver Restart
4. Configure Iptables Firewall
In the second step we use 5902 port, so we should open the corresponding port in iptables, otherwise we can't access the host from outside.
Iptables-a input-p tcp–-dport 5902-j ACCEPT
Service Iptables Save
5. Set Vncserver service to start
Chkconfig–level 345 Vncserver on
6. Testing
Testing under windows, I'm using the RealVNC viewer
Open the program, enter 192.168.1.10:5902 will default login test user
Configuring VNC Server in CentOS