1. Check whether the VNC client and server have been installed:
[Gavin @ centos ~] $ Rpm-q vnc-Server
Package VNC is not installed
Vnc-server-4.0-8.1
Cent OS 5 already contains the VNC installation package
2. Add the user name to the configuration file:
(Note: The "User Name" here refers to the name of a Linux User)
[Gavin @ centos ~] # Vi/Etc/sysconfig/vncservers
#
# Uncomment the line below to start a VNC Server on display: 1
# As my 'myusername' (adjust this to your own). You will also
# Need to set a VNC password; run 'man vncpasswd' to see how
# To Do That.
#
# Do not run this service if your local area network is
# Untrusted! For a secure way of using VNC, see
# Http://www.uk.research.att.com/vnc/sshvnc.html>.
# Vncservers = "1: myusername"
# Vncservers = "1: Gavin 2: John" # Use the method for more user
Vncservers = "1: Gavin 2: Root 3: Root"
# Vncserverargs [1] = "-geometry 800x600"
Vncserverargs [1] = "-geometry 1024x768"
3. Set the password for Gavin.
[Gavin @ centos ~] $ Vncpasswd
Password:
Verify:
4. Start the VNC service
[Gavin @ centos ~] #/Sbin/service vncserver start
Starting VNC Server: 1: Gavin [OK]
5. Enter the command
[Gavin @ centos ~] $ Cd ~ /. VNC/
[Gavin @ centos. 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 gray
Vncconfig-iconic &
# Xterm-geometry 80x24 + 10 + 10-ls-title "$ vncdesktop desktop "&
Gnome-session & # Set starting GNOME Desktop
# Startkde & # KDE Desktop
# TWM & # text interface
6. Restart vncserver
[Gavin @ centos ~] #/Sbin/service vncserver restart
Shutting down VNC Server: 1: Gavin [OK]
Starting VNC Server: 1: Gavin [OK]
7. log on to the VNC Server in Windows
(1). Log On from IE
Enter the following address in IE:
Http://xxx.xxx.xxx.xxx: 5802
Enter the password.
(2). Log On from VNC View
Install VNC view on Windows, enter XXX. XXX: 2, connect to log on, and enter the password.
NOTE: If connection refused (10061) is prompted when you log on from the VNC view, it is because of a Linux Firewall problem. log on to the centos system and select System --> preferences --> Remote Desktop, check the two items in sharing. If the two items are not checked, click Close and log on again with VNC view.