Install VNC Server in CentOS/Linux
VNC is short for Virtual Network Computing and is a remote control software. It supports remote graphical control across operating systems. In daily work, servers often have data centers, and it is impossible to run to the data center every time a graphical interface is required. Therefore, vnc is a good alternative software.
1. Check whether vncserver is installed on the local machine in CentOS/Linux.
# Rpm-qa | grep tigervnc
2. Install vncserver
# Yum-y install tigervnc-server
3. Start and set the vncserver Password
When you start vncserver for the first time, you will be prompted to enter the password. Then you need to use the vncpasswd command.
# Vncserver
Password:
Verify:
4. Modify the/root/. vnc/xstartup file.
Because the centos system we use here is installed with gnome Desktop
# Sed-I's/twm &/gnome-session &/'/root/. vnc/xstartup
5. Modify the/etc/sysconfig/vncservers file.
In this file, you can set the user who wants to run the VNC desktop and the screen resolution displayed when using the vncview connection. 1 In VNCSERVERS indicates that VNC runs on desktop 1. If you want to add another desktop, you can modify the configuration.
# Echo-e 'vncservers = "1: root"
VNCSERVERARGS [1] = "-geometry 1024x768"
'>/Etc/sysconfig/vncservers
6. Set it to boot
# Chkconfig -- add vncserver
# Chkconfig vncserver on
7. Restart vncserver
# Service vncserver restart
8. Open firewall ports
#/Sbin/iptables-I INPUT-p tcp -- dport 5901-j ACCEPT
#/Etc/rc. d/init. d/iptables save
9. view the startup status
# Netstat-tulnp
Note: If you access VNC through the VNC client, the port is 5901.
10. Others:
10.1: Change VNC Password
# Vncpasswd
10.2: Stop vnc server:
Vncserver-kill: desktop number
For example
# Vncserver-kill: 1
Note: The vncserver can only be disabled by the user who starts it, And the vncserver enabled by other users cannot be shut down by the root user immediately, unless the process is killed by using the kill command.
10.3: set the same display port to connect multiple clients
# Vncserver-alwaysshared
Install and configure VNC in CentOS 6.3
In Linux, the dependency installation VNC is not detected.
CentOS6 VNC service installation and configuration
VNC remote control installation and Setup
Windows accesses Ubuntu through VNC
Install VNC for accessing Ubuntu 12.04 through Windows Remote Desktop