Deploy the VNC Server and centos6vnc server in CentOS6
VNC (Virtual Network Computer) is short for Virtual Network Computer. VNC is a free open-source software based on UNIX and Linux operating systems. It has powerful remote control capabilities and is highly efficient and practical. Its performance can be comparable to any remote control software in Windows and MAC.
In Linux, VNC includes the following commands: vncserver, vncviewer, vncpasswd, and vncconnect.
The following uses CentOS6.2 as an example. The procedure for installing VNC is as follows:
1. Install gnome Desktop Environment
If the gnome desktop environment has been installed on the system, skip this step.
123456789 |
# Install fontforge to avoid box garbled characters in the font. yum install fontforge -y # Install gnome Desktop Environment yum groupinstall Desktop -y # Install the Chinese Language Support Package yum groupinstall 'Chinese Support' -y # Set the default system language to Chinese sed -i '/LANG/c\LANG="zh_CN.UTF-8"' /etc/sysconfig/i18n source /etc/sysconfig/i18n |
2. Deploy the vnc server
1234567891011 |
# Install the vnc software package yum install tigervnc tigervnc-server -y # Set vncserver startup chkconfig vncserver on # Set the vnc logon password. Save the password in ~ /. Vnc/passwd # If you want to change the vnc password of a common user, su must switch to this user first. vncpasswd # Viewing the vncserver configuration file rpm -qc tigervnc-server # Configuring vncserver vim /etc/sysconfig/vncservers |
12345 |
# Start the first and second desktops as root users VNCSERVERS="1:root 2:root" # Adjust resolution VNCSERVERARGS[1]="-geometry 1024x768" VNCSERVERARGS[2]="-geometry 1024x768" |
12345678910111213 |
# Start vncserver. The following two desktops are started: vncserver :1 vncserver :2 # Modify the xstartup file and change the last twm & to gnome-session & # This file appears only after vncserver is started. After modification, restart vncserver. vim ~/.vnc /xstartup # Stop vncserver vncserver - kill :1 vncserver - kill :2 # Configuring a firewall iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 5902 -j ACCEPT service iptables save |
Now that the server is deployed, you can access the Remote Desktop through UltraVNC Viewer, TigerVNC Viewer, or RealVNC Viewer.
The following describes common operations:
12345678 |
# Batch start service vncserver start # Batch restart service vncserver restart # Batch stop service vncserver stop # View the running Desktop vncserver -list |