Using VNC to remotely connect to a Linux Desktop

Source: Internet
Author: User

Network remote control technology refers to a computer (master) to control another computer (controlled), and when the master is on the control end, just as users sit in front of the controlled terminal, they can execute the controlled application and use the system resources of the controlled terminal.
VNC (Virtual Network Computing)Is a set of software developed by at&t lab that can manipulate remote computers. It adopts the GPL Authorization Clause and anyone can obtain the software for free. The VNC software consists of two parts:VNC Server and VNC Viewer.You must first install the VNC server on the controlled computer before you can control the controlled terminal on the control terminal.
(In windows, a set of well-known remote control software called pcAnywhere, is also released by Symantec.
VNC Server and VNC Viewer support multiple operating systems, such as UNIX, Linux, Solaris, windows, and MACOs, therefore, you can install the VNC Server and VNC Viewer in different operating systems for control. If the current master computer does not have VNC Viewer installed, you can control the control end through a general web browser.
The workflow for running the entire VNC is as follows:
(1) connect the VNC client to the VNC server through a browser or VNC Viewer.
(2) The VNC server sends a dialog window to the client, requiring that you enter the connection password and access the VNC Server display device.
(3) After the client enters the online password, the VNC Server verifies that the client has access permissions.
(4) If the client passes the VNC Server verification, the client requires the VNC server to display the desktop environment.
(5) The VNC server uses X protocol to require X server to assign control of the display to the VNC server.
(6) The VNC server will be sent to the client using the VNC communication protocol in the desktop environment of X server in the future, and allow the client to control the desktop environment and input device of the VNC server.

"Installation and Use of VNC 』
My operating environment: redhat8.0 on the control side and Windows XP on the control side.
1. Load the VNC Server and VNC Viewer.
VNC Server: http://www.linuxeden.com/download/softdetail.php? Softid = 744
VNC Viewer: http://download.pchome.net/php/dl.php? SID = 1, 2603
2. install.
Rpm-uvh vnc-3.3.6-2.i386.rpm (for source code, see the instructions in the package)
Install winvnc.exe
3. InStart VNC Server on Linux
Run the vncserver command:
[Root @ linux root] #Vncserver
You will require a password to access your tops.
Password: ---- to prevent anyone from remotely controlling the computer. Therefore, when
Verify: --- when you start the VNC Server once, you must set a password for remote control.
New 'X' desktop is Linux: 1 ---- remember this line will be used later.
Creating default startup script/root/. VNC/xstartup
Starting applications specified in/root/. VNC/xstartup
Log File is/root/. VNC/Linux: 1.log
(After the preceding steps, the VNC Server is started. If you want to change the VNC server password, you only need to execute the vncpasswd command .)
4. InRun VNC Viewer on Microsoft Windows
Run unzip vncviewer.exe directly. The connection details dialog box is displayed.
In the "connection details" dialog box, in the "VNC Server" text boxEnter the IP address of the VNC server.(Or host name and display device number, see 3. Start this line of the VNC Server on Linux. New 'X' desktop is Linux: 1 to get this information. For example: 192.168.0.1: 1 (1 after the colon is the display device number generated by the VNC Server). After you click the "OK" button, the VNC server starts to check the entered information. If the information is incorrect, the system displays the "failed to connect to server" error message: if the information is correct, the "VNC authentication" dialog box appears.
If the password entered in the "VNC authentication" dialog box is correct, you can successfully open the Linux desktop window.
5.Remote control from the browser.
Start the VNC Server and open your browser. in the address bar, enter the address or IP address of the controlled terminal, and add the port number ": 5800 + display number" to the address to control the computer.
For example: http: // 192.168.01.: 5801 (if the display number is 1, the display number set for the first time is 1, then 5800 + 1 = 5801 is used .)

6. FAQ
A. Why is there only one terminal window on the desktop after the connection?
Try to modify/root/. VNC/xstartup and change the last line of TWM & to gnome-session & or KDE & (it is said that KDE is not stable in the current VNC Viewer)

B. Why can't I connect after I restart the VNC server?
When you restart the VNC server, the system will specify a new display number. You must use this new number. Otherwise, the connection will fail.

2. install and use RedHat Linux 8.0 as an Example

In Linux, the use of VNC for graphical interface control is also very simple. VNC consists of two parts: the client application (vncviewer) and the server application (vncserver ).

1. Install the vnc rpm package

1. install linux

1.1 If the installation on the GUI is in KDE or gnome, click the RPM package and the system will automatically start the installation. You will also be prompted to set the password and port.

1.2 installation under the command line.

Next, let's talk about the installation under the command line, which is actually very simple, just a command.

CD/mnt/f/VNC/

Rpm-IVH vnc-3.3.6-2.i386.rpm

2. Set the VNC server access password

Vncpasswd

3. Start VNC Server

Vncserver

4. The management environment set by the VNC Server on Linux is TWM.

Let's change it to KDE. Modify the $ home/. VNC/xstartup file. After you change starttwm to startkde, restart the VNC server.

2. remote connection

Now you can control Linux on various platforms. The server (vncserver) also has a built-in Java Web interface, so that the user's operations on other computers through the server can be displayed through the browser (Java Applet must be supported, this operation process and display method are very intuitive and convenient.

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 need to install VNC. Fortunately, Red Hat Enterprise Linux as 4.0 already comes with VNC, which is also installed by default. You just need to configure it. However, the Windows client must be installed.

Vncserver Configuration:
1. Start VNC Server:
Open the terminal and run: vncserver
2. By default, the VNC Viewer can only view the command line of the VNC server.
To see the Linux desktop on the VNC Viewer, you need to make the following settings:
On the machine where the VNC Viewer is located, cancel the following two lines of comments in the/root/. VNC/xstartup file:
Unset session_manager
Exec/etc/X11/xinit/xinitrc
3. vncserver is automatically run after Linux is started.
1) Check the vncserver in system Settings> Server Settings> service.
2) Open the configuration file/etc/sysconfig/vncservers and remove the comments in the following line,
Vncservers = "1: Root"
Vncserverargs [1] = "-geometry 800x600"
1 indicates that VNC runs on desktop 1, so that the root desktop can be started.
4. VNC Port
If you want to control a Linux instance on the Intranet from the Internet, you need to open the corresponding port of the firewall and perform port ing on the vro.
The port number that VNC gives to the browser is 5800 + N, the port number for vncviewer is 5900 + N, and N is the set display number.

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

VNC Startup Mode
Vncserver-geometry 800*600
Vncserver-depth 16

 

 

 

Network remote control technology refers to a computer (master) to control another computer (controlled), and when the master is on the control end, just as users sit in front of the controlled terminal, they can execute the controlled application and use the system resources of the controlled terminal.

VNC (Virtual Network Computing) is a set of software developed by the at&t lab that can control remote computers. It adopts the GPL authorization terms and anyone can obtain the software for free. The VNC software consists of VNC Server and VNC Viewer. You must first install the VNC server on the controlled computer before you can control the controlled terminal on the control terminal.

VNC Server and VNC Viewer support multiple operating systems, such as UNIX, Linux, Solaris, windows, and MACOs, therefore, you can install the VNC Server and VNC Viewer in different operating systems for control. If the current master computer does not have VNC Viewer installed, you can control the control end through a general web browser.

The main working principle of VNC is to run the vncserver service on the server, and then remotely connect to the server desktop on the client.

This article describes how to connect to a Linux Remote Desktop from Windows

Installation and configuration
First install nvcserver in Linux, my Linux is fc6, install vnc-4.1.2-9.fc6.i386.rpm, installation package in the attachment.

/Upimg/soft/vnc-4.1.2-9.fc6.i386.rar

You can also search for the corresponding rpmpackage at http://rpm.pbone.net.
Install the RPM package
Root @. VNC # rps-ivh vnc-4.1.2-9.fc6.i386.rpm
Then enter ~ /. VNC
Root @. VNC # Cd ~ /. VNC
Edit file xstartup
Block the last line
# TWM &
Add the following statement
Gnome-session &
Save and exit

[Note] the above step is to display linxu desktop on windows; otherwise, only one terminal window is displayed.

Next, set the login user. If the installation is successful, there will be a vncservers file in the/etc/sysconfig/directory.
Open the vncservers file and add
Vncservers = "1: Root"

Now, set the VNC remote logon password.
Root @. VNC # vncpasswd

After setting the password, run vncserver
Root @. VNC # vncserver

New 'localhost. localdomain: 1 (Root) 'desktop is localhost. localdomain: 1

Starting applications specified in/root/. VNC/xstartup
Log File is/root/. VNC/localhost. localdomain: 1.log

OK. The Linux IP address is 10.0.0.107, and the service starts the port increasing from 5801.

Find a Windows machine on the same LAN, open IE browser, and enter
Http:/// 10.0.0.107: 5801
If the connection is successful, you can remotely control the Linux desktop after entering the password.

The quality of Logon using a browser is not good. You can use the vncview tool in Windows to connect directly.
Download a vnc-4.0-x86_win32.zip file, which is also included in the attachment.

/Upimg/soft/vnc-4.0-x86_win32.zip

After installation, click
VNC Viewer 4-> vncviewer.exe, enter the IP address, for example:

 

Press OK to go to the next step and enter the password to successfully control the Linux Desktop. Just like opening a Linux system.

Let's learn and make progress together.

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.