1. Install the required components
The server's component name is Vnc-server. Please perform rpm-q vnc-server this instruction.
Its output should be package Vnc-server is not installed or similar to Vnc-server-4.0-11.el4.
If the server is not installed, use this directive to install it: Yum install Vnc-server.
2. Set the user's VNC password
Execute VNCPASSWD, enter and Confirm password
3./etc/sysconfig/vncservers
vncservers= "1:root 2:root 3:root"
vncserverargs[1]= "-geometry 640x480"
vncserverargs[2]= "-geometry 800x600"
vncserverargs[3]= "-geometry 1024x768"
Three root, different resolution, of course can not set the user
4. Create Xstartup script, start Vncserver, stop
Service Vncserver Start
Service Vncserver Stop
Vncserver:1
Vncserver-kill:1
5. Editor Xstartup
CDs. VNC
VI 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" & #注释掉
#twm & #text
Gnome-session & #gnome
#startkde & #kde
6. Restart Vncserver
Service Vncserver Start
Chkconfig on
7. Use vncviewer input ip:1, enter VNC password successfully enter
Done
The Chinese wiki has a more detailed configuration:
Http://wiki.centos.org/zh/HowTos/VNC-Server