First you need to check to see if the server has VNC service installed and check that the server has the following command to install VNC:
Rpm-qa | grep VNC
Using the above command the information returned to me here is the following (if there is no display, the system does not have VNC package installed)
tigervnc-1.1.0-5.el6.i686
tigervnc-server-1.1.0-5.el6.i686
If VNC is not installed, you can install it using the following command:
Yum Install Tigervnc Tigervnc-server
Then there is the configuration problem after installation.
Edit the configuration file using the following command:
Vi/etc/sysconfig/vncservers
When using the above command, you may already have this profile on your server, or you may not have the configuration file on your server, and add the following to the configuration file:
Vncservers= "1:root"
vncserverargs[1]= "-geometry 800x600"
The following section is the configuration file annotation above, for reference purposes:
#这个是配置远程桌面登录的用户名, if two users, then use vncservers= "1:user1 2:user2",
By analogy, by default, the 1:user1 corresponds to the 5901,2:user2 corresponding 5902 (VNC's default listener port is 5900, and the listening port rule is 590+usernumber), as follows
Vncservers= "Usernumber:myusername"
#下面这项配置为登录桌面配置, where "1" is the user serial number, 800x600 is the resolution,-nolisten TCP is the blocking TCP packet, and the-localhost representative listens only locally,
vncserverargs[1]= "-geometry 800x600-nolisten tcp-localhost"
If you want to block HTTP packets, you can use the following configuration
vncserverargs[1]= "-geometry 800x600-nolisten tcp-nohttpd-localhost"
Use the following command to set a password for VNC (you need to use SU to switch to the user who is setting the VNC password, such as Su user1, where User1 is the account that is written in the configuration file above)
vncpasswd
After you set up your password, you start VNC service, and you start the VNC service by switching to the account that you want to start the service with Su User1 (User1 is the account that is written in the configuration file above) (many friends are unable to connect when using the Directspace default desktop VNC) "10061 Error", you can enter the following command in SSH to resolve!)
Vncserver
Other commands, such as restarting the VNC service, use the following command:
Service Vncserver Restart
The VNC service boots up with the following command:
Chkconfig Vncserver on
In some minimal system, even if the English will appear box garbled, please use the order of the department to amend: yum-y install FontForge
Other Description:
When set up, use Servers Vncserver start (if you can't start, check to see if the software is installed properly, check the/ETC/RC.D/INIT.D directory for Vncserver control scripts),
After startup, use Netstat-nat to view the listening port (default is 5901,5902,5903, etc.), and if the firewall is turned on, a configuration rule is required to allow the corresponding port TCP packet to pass.
Reference configuration: Iptables-i INPUT 1-p tcp--dport 5901-j ACCEPT (where-I input 1 represents the insertion of a rule, where the rule is 1, please refer to iptables related configuration for details)
If you encounter the following questions:
Starting VNC server:
Warning:the attempt to star Xvnc failed,possibly because the font catalog was not properly configured, attempting to Determine an appropriate font path to this system and restart Xvnc using that font path ...
The above situation is caused by a font path problem,
Workaround: Update the Font library, and by updating the interface you can see that there are many X11 update packages that install them,
If you don't know exactly which one to install, you can update all the packages, of course it takes longer (command: yum-y upgrade),
If there are no other problems, using servers Vncserver start should be able to start successfully.