1. use yuminstalltigervnc-server to install vnc2 and modify the configuration file [root @ localhost ~] # Cat/etc/sysconfig/vncservers # TheVNCSERVERSvariableisalistofdisplay: userpairs. # Uncommentthelinesbelow 1. use yum install tigervnc-server to install vnc
2. modify the configuration file
[Root @ localhost ~] # Cat/etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display: user pairs.
#
# Uncomment the lines below to start a VNC server on display: 2
# 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 this URL:
# Http://kbase.redhat.com/faq/docs/DOC-7028
# Use "-nolisten tcp" to prevent X connections to your VNC server via TCP.
# Use "-localhost" to prevent remote VNC clients connecting tables T when
# Doing so through a secure tunnel. See the "-via" option in
# 'Man vncviewer 'manual page.
# VNCSERVERS = "10: myusername"
# VNCSERVERARGS [1] = "-geometry 800x600-nolisten tcp-localhost"
Remove # VNCSERVERS = "10: myusername"
# VNCSERVERARGS [1] = "-geometry 800x600-nolisten tcp-localhost" the "#" before the two statements (that is, remove the comment)
Change myusername to the user name you log on to. set the preceding number. vnc is defined by Port + desktop number,
The vnc port is 5900. here, my desktop number is 10. when connecting to the vnc, the port is 5900 + 10, that is, 5910.
"1" in VNCSERVERARGS [1] indicates that I only open services to one user.
3. set the password
[Root @ localhost ~] # Vncserver
After entering the vncserver, the system prompts you to set the password.
You will require a password to access your tops.
Password:
Verify:
4. restart the service
[Root @ localhost ~] # Service vncserver restart
If prompted
Starting VNC server: 1: root
WARNING: The first attempt to start Xvnc failed, possibly because the font
Catalog is not properly configured. Attempting to determine an appropriate
Font path for this system and restart Xvnc using that font path...
Cocould not start Xvnc.
/Usr/bin/Xvnc: symbol lookup error:/usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
/Usr/bin/Xvnc: symbol lookup error:/usr/bin/Xvnc: undefined symbol: pixman_composite_trapezoids
Install the missing package.
[root@localhost ~]# yum install pixman pixman-devel libXfont
Restart again.
5. we recommend that you add this port to the firewall and set it to a boot entry.
[root@localhost ~]#
iptables -I INPUT -p tcp --dport 5901 -j ACCEPT
[root@localhost ~]#
Chkconfig vncserver on
6. restart the firewall.
7. test the connection on the client. the ip address of my server is 192.168.7.198, enter 192.168.7.198: 10 on the client, and the password is the password set in step 3.