Document declaration: Installation Process on CentOS5.4 desktop. This article is only a personal installation process, where the software configuration scheme is only selected based on personal needs, may not meet all the needs. The configuration may also be incorrect due to personal capacity issues, not optimal, or redundant configuration options. Thank you for your understanding.
Port,
By default, the port starts from 5900 and your desktop number is added.
For example, if your desktop number is 1, the connection Port Number of vnc is 5900 + 1 = 5901.
For example, if your desktop number is 10000, the connection Port Number of vnc is 5900 + 10000 = 15900.
========================================================== ====================================
Configure the VNC Server below so that the user (root) can remotely connect to the linux system GUI through the vnc client (provided that the desktop is installed on your server)
1. Check whether VNC is installed in linux.
Rpm-q vnc-server
"Package vnc-server is not installed" indicates that the vnc server is not installed.
Run the following command to install vnc.
Yum install vnc-server
2. Start the vnc service
Vncserver
You will require a password to access yourdomaintops.
Password:
Verify:
You will be prompted to enter the password, which is required for remote logon. Enter the password and press Enter.
4. Switch to the root account: su root and enter the password of the root account.
Vim/etc/sysconfig/vncservers # vnc configuration file
Remove the comments of the following two lines.
VNCSERVERS = "1: root" #1: root (desktop number: User), configure to start desktop 1
VNCSERVERARGS [2] = "-geometry 1204x768-nolisten tcp-localhost"
// 800x600 indicates the desktop resolution
Save and exit
5. Restart the vnc server.
Method 1: etc/init. d/vncserver restart
Method 2: service vncserver restart
6. Set the vnc server to automatically start upon startup
Vi/etc/rc. local
Add the following content to the file
/Etc/init. d/vncserverstart
7. Change the vnc connection password
Vncpasswd
8. Connect to the Remote Desktop
Use SecureCRT to connect to the target machine.
Run the iptables-F command,
Connect to the VNC Viewer.
After the Remote Desktop is accepted, restart the firewall to create a remote vnc connection.
Note: If the gray screen appears after the connection, you can set it as follows:
Go to the user's home directory
Cd/home/user
If you log on with the root account, the current directory is the root directory of the user.
Cd ~ /. Vnc
Vi xstartup # Edit
# Twm & # comment out this line
Gnome-session & # Add this line