This article illustrates the installation and use of VNC Remote Desktop program in CentOS. Share to everyone for your reference, specific as follows:
Here take CentOS 6.5 as an example
Installing the GNOME desktop environment
Yum Groupinstall "X Window System" "Desktop"
CentOS Install XFCE desktop environment, optional
Install Tigervnc
Yum Install Tigervnc-server Tigervnc
Set up a remote login to the GNOME desktop configuration, and then add the following two lines to the final side:
Vim/etc/sysconfig/vncservers
vncservers= "1:root"
vncserverargs[1]= "-geometry 1024x768-alwaysshared-depth 24"
Modify Remote Desktop Display profile: Modify to the following and save
Vim/root/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
unset session_manager
exec/etc/x11/xinit/ XINITRC
[-x/etc/vnc/xstartup] && exec/etc/vnc/xstartup
[-R $HOME/. Xresources] && Xrdb $HOME/. Xresources
xsetroot-solid Grey
vncconfig-iconic &
xterm-geometry 80x24+10+10-ls-title "$VNCDESKTOP Desktop "&
gnome-session & #set starting gnome Desktop
#startkde & #kde Desktop
#twm & #Tex T interface
#/usr/bin/startxfce4
#exec/usr/bin/fluxbox
To create a new service, multiple services are built several times, followed by: 1:2: 3, which prompts you to set a password every time you start
Close the specific vncserver command
Vncserver-kill:1
Vncserver-kill:2
power-on Boot
Firewall settings
When you start the VNC service, you can use the NETSTAT–TUNLP command to view the ports used by VNC services, and you can find 5801,5901,6001. Use the following command to open these ports:
Reboot the firewall:
# NETSTAT–TUNLP
Proto recv-q send-q Local address Foreign address State pid/program name
TCP 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 2092/xvnc
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1459/rpcbind
tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 2092/xvnc
TCP 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1711/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1557/cupsd
# vim/etc/sysconfig/iptables
-A Rh-firewall-l-input-p tcp-m tcp–dport 5801-j ACCEPT
-A rh-firewall-l-input-p tcp-m tcp–dport 5901-j 8/>-a rh-firewall-l-input-p tcp-m tcp–dport 6001-j ACCEPT
#/etc/init.d/iptables Restart
To install a Windows client:
Http://sourceforge.net/projects/tigervnc/files/latest/download
Start Trigervnc Viewer
Enter the server ip:01, for example: 192.168.1.10:1
Connect to the CentOS desktop by entering the password you set each time you start Vncserver
I hope this article will help you to CentOS server operations.