Xming + PuTTY a GUI program for remote Linux Hosts in Windows

Source: Internet
Author: User
Xming + PuTTY in a Windows Remote Linux host uses the GUI Program-Linux Enterprise Application-Linux server application information. The following is a detailed description. Cause
The subsequent work requires some numerical simulation, so I opened an account on my brother's workstation. The workstation runs RHEL4. To say remote SSH, even the FTerm is sufficient. However, it is troublesome to use the graphic interface to view the computing result. With VNC, resources are consumed, and VNC is not doing well in win.

Reference
Remember the Computer Experiment of the last semester's large-scale design. Dozens of people used XShell SSH to run the Solaris Sun workstation in the experimental center from the PC running Windows XP, and run the Cadence tool set, that is, it has a GUI. So I thought, can I do the same? I sent an email to the Debian Chinese and Ubuntu Chinese mail lists, raised this question, sorted it out based on the replies on the list, and basically understood how to do it, the details are still unclear, so let's talk about it first.

I. Principles
Linux/Unix X Windows have network transparency. In the X Window System, there is a unified Server responsible for the interaction between various programs and input/output devices, such as monitors, keyboards, and mice, each GUI application interacts with the Server through the network protocol. Therefore, for any application, the difference between local running and remote running is only that the address of X Server is different, and nothing else. Therefore, if you run an X Server in Windows, you can easily remotely run a Linux application with a GUI. At the same time, OpenSSH has the X forwarding function, which can forward the X program of the Linux host to the client through the SSH pipeline. Therefore, PuTTY is used to send the received interaction of the X program forwarded by the host to the X Server running on the local Windows system for management and display. In principle, this allows you to remotely use Linux GUI programs.

Configurations required on the host:
# Vi/etc/ssh/sshd_config

Uncomment this line -- manually add it if this line does not exist:
X11Forwrding yes

This configuration allows ssh x forwarding. In essence, there is a certain security risk in doing so. SSH cannot guarantee the security of your data. However, this is enough in general.

Ii. Install Xming
You need to run an X Server on a local Windows Server. There are many choices: the X Server under Cygwin is probably the most famous, but it seems a little exaggerated to install a "relatively huge" Cygwin for such a small thing; except Cygwin, there are also two well-known commercial software available, Xwin32 and Xmanager. Xmanager was used in the IC experiment last semester, and it feels smooth and easy to use. However, although Xmanager can be used for trial, but after all, it is still commercial software. There is another option. Here we will talk about the open-source software Xming.

Xming is an open-source X Server with simple configuration and powerful functions. It can run in the XP/2003/Vista operating system of M $.

Xming home page: http://www.straightrunning.com/XmingNotes/
Xming SourceForge page: http://sourceforge.net/projects/xming/

Download xming-setup.exe from sourceforge( the latest version is 6.9.0.31) and install it locally. Run the XLaunch in the Start menu for the first time to generate an initial configuration file. For simple use, no special configuration is required. Use the default configuration. For specific configuration and use of Xming, refer to the Manual of Xming. Remember the number in the "Display number" marked in. The default value 0 is used here.

After it is started, an "X" icon will appear in the tray area. This indicates that Xming is running. Hover the mouse over it to see the currently used "Display number ".

3. Configure PuTTY
In Windows, there are many clients that support SSH, Telnet, and other remote logon protocols, such as SecureCRT, XShell, and PuTTY. Even the FTerm used for logging on to BBS has the SSH function, it's not as professional and powerful as PuTTY.

I use the famous free PuTTY, And I believe many people choose the same way as me. Therefore, we will not go into detail about the configuration and use of PuTTY. Add PuTTY support for X forwarding. Run PuTTY. On the configuration page, select "Connection-SSh-X11", select "Enable X11forwarding", and fill in the number in "display number" in the previous step in "X Display location" ("localhost: 0 ").

Connect to the remote host, and everything looks normal.

Iv. Problems and Solutions
So try to run emacs! Hey! The graphic interface really came out. Why can't I see any text? Are there some squares?

Check the terminal output information:
-Bash-2.05b $ emacs
Warning: Cannot convert string "-*-courier-medium-r-*-120-*-iso8859-*" to type FontStruct
Warning: Cannot convert string "-*-helvetica-medium-r-* -- *-120-*-iso8859-1" to type FontStruct

Oh, it turns out that Xming has no corresponding font!

Check manual on the Xming homepage. You can add Windows system fonts for Xming, or use the fonts provided by Xming.

The xmingpattern text is very simple. Download xming-fonts-setup.exe (the latest version is 7.3.0.15) from the xmingsourceforgepage and install it to the Xming installation path. My Xming installation path is D: \ Program \ Xming \, And the font path after the installation is D: \ Program \ Xming \ fonts \. After testing, the emacs font can be properly displayed after the font is installed.

If you do not want to install the font, you can also use the Windows system font for Xming. But how to configure it?

Do you still remember how to add fonts in Linux? By the way, the mkfontscale tool is used to generate cache files for fonts.

To this end, download Xming-tools-and-clients from the SourceForge page of Xming and decompress it to the installation path of Xming. Switch to Windows cmd (command prompt), cd to the Xming directory, and execute the following command:

> Mkfontscale C:/WINDOWS/Fonts
> Mkfontscale-B-s-l C:/WINDOWS/Fonts # ignore the 'cooldn' t... fon 'messages

Edit the font-dirs file under the installation path of Xming and add the font path:
C: \ WINDOWS \ Fonts

Remember: Even in Windows, it is still a good habit to be case sensitive.

OK! Let's try again. Hey, is it more normal for the sub-emacs?

Small Tips: Use your firewall to block Xming from accessing the network. Because such an X Server is inherently insecure, and you don't need it to connect to the Internet, because you only use it on the local machine.

Feeling: Xming is still inferior to Xmanager in general, and there is still a large gap in the smoothness of the operation, especially when the mouse moves, it feels like a meal, even in the LAN, there are not many situations.

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.