1. Check whether your Linux system has VNC installed.
[Root @ serv1 ~] # Rpm-q vnc-Server
Vnc-server-4.1.2-14.el5_6.6
The above information indicates that the VNC service has been installed.
2. Start the VNC service
[Root @ serv1 ~] # Vncserver: 1
You will require a password to access your tops.
Password:
Verify:
Xauth: creating new authority file/root/. Xauthority
New 'serv1 .ganjh.com: 1 (Root) 'desktop is serv1.ganjh.com: 1
Creating default startup script/root/. VNC/xstartup
Starting applications specified in/root/. VNC/xstartup
Log File is/root/. VNC/serv1.ganjh.com: 1.log
The system prompts you to enter the password, which is the password for the client VNC to log on to Linux.
3. Check whether port and port 5901 are enabled in Linux.
[Root @ serv1 ~] # Iptables-I input-P TCP -- dport 5901-J accept
[Root @ serv1 ~] # Iptables-I input-P TCP -- dport 5801-J accept
4. Use the VNC Viewer software to log on to the test. The procedure is as follows: Start the VNC Viewer software -->
Server Input "172.25.6.249: 1" --> click "OK" -->
Enter the login password --> click "OK" to log on to the X-Window Graphic desktop environment --> the test is successful.
5. The preceding method only configures the character interface. If you want to see the gnome interface, you must modify the Linux configuration file.
VI/root/. VNC/xstartup
Delete the content and replace it with the following
#! /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 "&
TWM &
6. Restart the VNC server.
[Root @ serv1 ~] # Vncserver-kill: 1
Killing xvnc process ID 4046.
[Root @ serv1 ~] # Vncserver: 1
New 'serv1 .ganjh.com: 1 (Root) 'desktop is serv1.ganjh.com: 1
Starting applications specified in/root/. VNC/xstartup
Log File is/root/. VNC/serv1.ganjh.com: 1.log