码迷,mamicode.com
首页 > 其他好文 > 详细

X11 Forwarding using Xming and PuTTY

时间:2015-05-11 17:54:32      阅读:539      评论:0      收藏:0      [点我收藏+]

标签:putty   xming   x11协议   

We can run graphical programs on Linux/Solaris machines on campus remotely and display them on your desktop computer running Windows. We can do this by using running two applications together on your Windows machine: Xming and PuTTY.

What is Xming?

Xming is a PC X Window Server. This enables programs being run remotely to be displayed on your desktop. Download and run the installation program from: http://sourceforge.net/projects/xming/
Navigate to the Files section and download:
Xming setup from the Xming folder
the fonts package installer from the Xming-fonts folder
By default both programs will be installed into the same location, so don’t the worry about over writing files. We cannot work without both packages.
Once installed, running All Programs > Xming > XLaunch is a good idea to see what the configuration looks like. In most cases, the default options should be just fine.
Finally run All Programs > Xming > Xming to start the PC X Server. The “X” icon should be visible on the Windows Taskbar, as in the image below. The X Server must be started before setting up a SSH connection to a campus machine.
技术分享

What is PuTTY?

PuTTY is a free SSH client. Through PuTTY we connect to a remote machine on the UT Dallas campus. Download the single Windows executable file from: http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html There is no setup required, you can run by simply double clicking putty.exe.
Configuring PuTTY
Under Session, enter the hostname you want to connect to: apache.utdallas.edu on port 22. Make sure the connection type is ssh.
技术分享

  1. Next, scroll to Connection > SSH > X11. Check the box next to Enable X11 Forwarding. By default the X Display location is empty. You can enter localhost:0. The remote authentication should be set to MIT-Magic-Cookie-1
  2. Finally go back to Session. You can save your session too, and load it each time you want to connect.
  3. Click Open to bring up the terminal and login using your netid/password .
    技术分享

Open a graphical application by typing the command name

{apache:~} gvim itworks.txt & 

The ampersand runs the command in background so that you can work on your terminal and run the graphical application.

Tips

To connect to solarium for instance, connect to apache as above and then from the terminal:

{apache:~} sshX solarium

The -X switch as you guessed enables X11 forwarding. You can run X11 applications on solarium now!

A few gotchas

  • Error message - X connection to localhost:47.0 broken (explicit kill
    or server shutdown).
    • Fix: Check X server is running. Did you forget to start Xming before
      connecting to the server?
  • Error message - cannot open display
    • Fix: Is the DISPLAY variable set? Did you set X11 forwarding by
      adding the -X switch to the ssh command?
  • gVim Error message - E665: Cannot start GUI, no valid font found

    • Fix? Download and install fonts DejaVu-fonts.zip. The latest version
      of the DejaVu Fonts can be downloaded from the DejaVu Download Page.
  • Cadence Error message - X Error of failed request: BadName (named
    color or font does not exist)

    • FIX: Download and install fonts Xming-fonts-7-5-0-25-setup.exe. The
      latest version of the Xming fonts pack can be downloaded from the
      Xming files list.

X11 Forwarding using Xming and PuTTY

标签:putty   xming   x11协议   

原文地址:http://blog.csdn.net/jason_wang1989/article/details/45646261

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!