1. install required components
The component name of the server is VNC-server. Run the rpm-q vnc-server command.
Its output should be package VNC-server is not installed or similar to a vnc-server-4.0-11.el4.
If the server is not installed, use this command to install it: Yum install VNC-server.
2. Set the user's VNC Password
Run vncpasswd and enter and confirm the 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 users, with different resolutions. Of course, users cannot be set.
4. Create an xstartup script, start vncserver, and stopStop
Service vncserver start
Service vncserver stop
Vncserver: 1
Vncserver-kill: 1
5. Edit xstartup
CD. VNC
VI xstartup
#! /Bin/sh
# Uncomment the following two lines for normal desktop:
Unset session_manager # Remove comments
Exec/etc/X11/xinit/xinitrc # Remove comments
[-X/etc/VNC/xstartup] & exec/etc/VNC/xstartup
[-R $ home/. Xresources] & xrdb $ home/. Xresources
Xsetroot-solid gray
Vncconfig-iconic &
# Xterm-geometry 80x24 + 10 + 10-ls-title "$ vncdesktop desktop "& # Comment out
# TWM & # Text
Gnome-session & # Gnome
# Startkde & # KDE
6. Restart vncserver
Service vncserver start
Chkconfig on
7. Use vncviewer to enter IP: 1, and enter the VNC password.
Done
The Chinese Wiki has more detailed Configuration:
Http://wiki.centos.org/zh/HowTos/VNC-Server