Use VNC Remote Desktop Connection in Centos5.6

Source: Internet
Author: User
Tags ultravnc viewer


1. First, check whether desktop access is installed.
Yum groupinstall "X Window System"
Yum groupinstall "GNOME Desktop Environment"
 
VNC (Virtual Network Computing) Virtual Network Computing tool is essentially a remote display system. The administrator can not only view the desktop environment on the local machine where the program runs, in addition, you can view the running status of remote machines anywhere on the Internet, and it has cross-platform features.
 
To use Remote Desktop in Linux, you must install VNC,
 
1. First, check whether the vnc-server software package has been installed. Run the following command:
 
Rpm-qa | grep vnc-server
 
If not, run the following command:
 
Yum install vnc-server
 
2. Set the user that can be connected through VNC to modify the file/etc/sysconfig/vncservers:
 
VNCSERVERS = "2: haha"
VNCSERVERARGS [2] = "-geometry 800 × 600-nolisten tcp-nohttpd"
 
Parameter description:-geometry 800x600 desktop resolution-nolisten tcp prevents TCP connection to the VNC Server
 
[Note] VNCSERVERS = "2: haha" The haha user is assigned a VNC desktop with the desktop number "2. The desktop number must be greater than 1. Different users must specify different desktop numbers. The address entered in the VNC connection client is similar to xxx. xx: 2, and the user desktop is connected directly to haha.
 
 
3. Set a password for the VNC user and go to the haha user directory to check whether there is a hidden directory. vnc:
 
Cd/home/haha
 
Ls-
 
If there is no. vnc directory, use the haha user to create the. vnc directory:
 
Su haha
 
Mkdir. vnc
 
Cd. vnc
 
Go to the. vnc directory and run the following command to set the password:
 
Vncpasswd
 
You will be prompted to enter the password twice;
 
Then exit the haha user, run the exit command, and return to the root user;
 
Run the following command to start vncserver:
 
Service vncserver start
 
Normally, related files will be created and vncserver will be started. Then you can connect to the VNC client to see the interface, but the default is a terminal interface, to use GNOME or KDE, you also need to modify the user directory. vnc/xstartup:
 
Vi/home/haha/. vnc/xstartup
 
The file content is roughly as follows:
 
#! /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 &
 
Gnome-session &
 
Comment out the xterm and twm lines and add the gnome interface later.
 
Another method is to remove the comment # Before the following two rows, and then comment out or delete all other rows.
 
Unset SESSION_MANAGER
 
Exec/etc/X11/xinit/xinitrc
 
But the prompt in it says it is not recommended.
 
4. Run the following command to kill the haha user VNC desktop:
 
Vncserver-kill: 2
 
Or stop vnc-server. Run the following command:
 
Service vncserver stop
 
Then start vnc-server to connect to the gnome graphics desktop.
 
In windows 7, I used the UltraVNC Viewer client to connect.
 
 
 
5. If a firewall is enabled, enable the relevant port. The port number is 5900 + desktop number. For example, if the haha user desktop number is 2, the open port is 5902;
 
 
 
 
 
Configuration of Windows client VNC Viewer:
1. Download VNC Free Edition for Windows Version 4.1.2 from the http://www.realvnc.com/download.html
 
2. Open VNCViewer:
Enter the IP address of the VNCServer: Number (1 or 2 or ...)
 
3. VNCViewer switch to full screen mode: F8

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.