Remote Desktop Connection under Windows Linux-vnc

Source: Internet
Author: User
Tags ssh port

VNC was developed by the at and T Lab and is an excellent remote control tool software that was later open source in the form of GPL-licensed. After several years of development, now VNC has not only refers to a software, but a class of software generic term. Below is a description of the two VNC software commonly used under Linux.

The principle of VNC is to constantly screen the window interface, and then transfer the image to the client, while the VNC server side takes over the server side of the keyboard, mouse control, the client can be manipulated by the server side keyboard mouse. Compare pcanywhere similar to Windows.

First, Windows-side settings

First, the Windows side is because the following two VNC can be connected with the same client.

On the Windows platform, the client I chose RealVNC. RealVNC includes a full set of server side and client, if only install the client is not required registration code, its client program named Vncviewer.exe, this is a green software, you can copy from the installation directory to other computers to run.

Second, VINO

Vino is a VNC software integrated in GNOME, installed by default when installing the GNOME environment, click "System"-"preferences"-"Remote Desktop" to open its configuration window.

When you select Allow others to view your desktop, Vino starts the server-side process vino-server, and it listens on TCP 5900 ports. If you do not select Allow other users to control your desktop, the client can only watch that it cannot manipulate.

Vino mode is very different from the XVNC described below, I think vino is actually "Remote Assistance under Windows", because the client displays the desktop as shown in the Linux side of the local display of the desktop, if you manipulate the mouse in the client, the Linux display can see the mouse running. If you installed the VNC server side under Windows, the effect is this kind.

In addition, the bandwidth of vino is abnormal, even if it is a desktop nothing open no operation, bandwidth also to occupy the 4-5mbps (desktop 1280x1024, color 24), if there is operation will account for 8-12mbps.

Therefore, vino is not suitable for the daily remote management of the server, more suitable for Linux Remote Assistance and distance learning, that is, you encounter a problem, help master, and master can hand-taught you, you can directly watch the screen to learn, or do a failure to reproduce, you do fault in the local or bug reproduce, and engineers can watch it remotely.

Third, XVNC

Xvnc is a familiar vnc or vncserver, the open source version of VNC software developed by RealVNC company.

1, install XVNC.

When you install Linux, you can select it from the installation package. If it is not installed, it can be found from the installation disk.

The component of the server is called Vnc-server. Please execute rpm-q vnc-server this command.

Its output should be package Vnc-server are not installed or similar to vnc-server-4.0-11.el4.

If the server is not installed, use this command to install it: Yum install Vnc-server.

2, start Vncserver.

In the terminal, enter:

Vncserver:1-geometry 1280x1024–depth 24 Note: 1 means 1th window,-geometry refers to the window resolution,-depth refers to the number of colors

You can also simply specify:

Vncserver:1 Note: With RealVNC client, the window resolution and number of colors can be specified in the client

When you start Vncserver for the first time, you will be asked to specify a password that is to be entered when the VNC client connects.

The window can be specified starting at 0, and if the Linux local side already has a graphics environment enabled, it must be specified starting from 1 because window 0 is X11 occupied.

3, Configuration Xstartup

Xvnc default to TWM as a graphical environment, if you install KDE or GNOME can also be launched.

VI ~/.vnc/xstartup

Displays the following:

#!/bin/sh

# Uncomment the following-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 Grey

Vncconfig-iconic &

Xterm-geometry 80x24+10+10-ls-title "$VNCDESKTOP Desktop" &

TWM &

The last line Twm & means start twm, modify to Gnome-session & start Gnome, change to Startkde & start KDE.

If the Linux local side already has a GNOME or KDE graphics environment enabled, when the VNC client connects to the server, it may display only the gray screen, and the graphics environment is not enabled properly. You will be prompted with an error when viewing logs under ~/.vnc: Already running a session manager.

You need to remove the Xstartup file from the

# unset Session_manager

# EXEC/ETC/X11/XINIT/XINITRC

These two lines before the #, and then restart Vncserver. If the Linux local side is init 3 mode, you do not need to modify these two lines.

When the VNC client connects to the server, the interface displayed is English, mainly the Chinese environment has not been loaded, and there is no Chinese input method. After the # EXEC/ETC/X11/XINIT/XINITRC line, add the following:

Export LANG=ZH_CN. UTF-8 Note: Enabling the Chinese environment

Scim–d Note: Load SCIM ime

4. Close Vncserver

Vncserver–kill:1 Note: Close window 1, and so close window 2 is: 2

When all windows are closed the Vncserver service is turned off.

5. Client Use

Xvnc not only supports Vncview and other client programs, but also supports browser control.

When the browser enters the address http://IP:5800 directly, the Java Client connection is initiated.

Windows 0 occupies TCP 5900 port (VNC client), TCP 5800 port (browser).

Windows 1 occupies TCP 5901 port (VNC client), TCP 5801 port (browser).

Windows 2, 3, and so on.

6, boot from start vncserver

The above operation is to log on to the Linux side first, and then manually start the Vncserver service before you can use the VNC connection. If you want to boot from the Vncserver service, you must do so.

Start the Vncserver once by following the steps above to make sure that both the password and the Xstartup file are established.

Then, Vi/etc/sysconfig/vncservers, add the following:

vncservers= "1:root 2:zhang 3:li" NOTE: 1, 2, 3 for Windows, such as the root user with Windows 1,zhang users with Windows 2, where the user refers to the regular user account in Linux

vncserverargs[1]= "-geometry 640x480–depth 24" Note: Specify the resolution and number of colors for the root user, where [1] refers to the "1:root" above

vncserverargs[2]= "-geometry 640x480–depth 16" Note: Specify the resolution and number of colors for the Zhang user

vncserverargs[3]= "-geometry 800x600"

Note: The above three lines may not be added, and the VNC client will control the resolution and color itself. The root, Zhang, and Li users above must ensure that both the password and the Xstartup file are established, and you can log in first to perform a vncserver:1.

Finally, execute the/sbin/chkconfig vncserver on command.

7. Security

XVNC data transmission is clear, because it involves the management of the server, the use of clear text is unacceptable.

We can encrypt VNC data using SSH.

First, start the SSH service on the Linux side.

Second, download an SSH telnet tool on the Windows side. PUTTY,SECURECRT is recommended.

Third, enable SSH tunneling. The following takes SecureCRT as an example, the putty operation is similar.

First establish a normal SSH session connected to the Linux side.

In the session option, in port forwarding, add local port forwarding properties.

See the picture on the right, enter a port in "local", here Select 5901, you can also choose 5801 or other port, as long as not with the local service, this local port is not related to the Vncserver listening window port in Linux, in "remote" input 5901, This port is the Linux side of the Vncserver listening port, here is the start window 1, if the Startup window 2 here to enter 5902. Are you sure.

After Setup, start an SSH session with Linux in SecureCRT and log in to Linux correctly. Open Vncviewer.

In the VNC server, enter: localhost:5901 (the port here is the local port specified above, not the Linux port), because this is to connect to the local SECURECRT-initiated SSH tunnel. The SECURECRT cannot be closed during VNC operation.

In this way, the firewall on the Linux side can only open the SSH port, shutting down all the ports about VNC.

8. Conclusion

Xvnc is a very good daily use of server management tools, you can adjust the picture quality according to your network bandwidth, if your bandwidth is small, you can adjust the small resolution and color number, XVNC no Operation basic no data, if it is 800x600 resolution, the worst picture quality, it will only account for hundreds of KB or even more than 10 KB of bandwidth , which is ideal for server management.

Remote Desktop Connection under Windows Linux-vnc

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.