CSS Corp Open Source Services

X11 Forwarding using XMing and SSH Client

leave a comment »

Overview

Xming (http://freedesktop.org/wiki/Xming) is an X Windows port for Microsoft Windows. Essentially it’s an X-server which starts transparently on top of your MS Windows desktop. It allows you to redirect graphical output of applications you run on remote *nix servers and therefore see these applications windows on your MS Windows desktop. Xming is very simple and easy to use. You can download its distribution archive from the project’s page on SourceForge: XMing @ SourceForge (http://sourceforge.net/projects/xming).
This article explains on how to use Xming to run graphical applications on remote *nix servers and see the output on your windows desktop

Software Requirements

Installation of Xming

  1. Download and run the current setup executable available from http://sourceforge.net/projects/xming/files/Xming-mesa/6.9.0.31/Xming-mesa-6-9-0-31-setup.exe/download. You will see the following intro screen. Click [Next].
  2. The default installation location is recommended. Click [Next].
  3. The following installation components should be fine for most users. Also, we recommend installing PuTTY separately. Click [Next].
  4. The Start Menu folder is simply the name of the sub directory under which your Xming shortcuts will be located. The default value should be fine. Click [Next].
  5. Additional tasks include creating shortcuts in various locations to make the Xming server easier to access. The following option set is reasonable. XLaunch provides a graphical launcher with easy access to more advanced features of Xming. Most users will not need to use these advanced features and can leave the XLaunch options unchecked (the shortcuts will still exist in the Start Menu). Click [Next].
  6. The installer will verify the settings. The one to be certain to verify is the destination location. Using any installation directory other than the default will make font installation and use slightly more complicated. Click [Install].
  7. Following a brief installation status screen, you should see the following dialog indicating successful installation of Xming. You are now equipped to view X11-based graphical applications remotely. Click [Finish].

Installing Additional Fonts

  1. It is recommended to install the additional fonts for Xming(http://sourceforge.net/project/downloading.php). The “Xming-fonts” package can be downloaded from http://sourceforge.net/project/downloading.php. Installation is identical to that of above, with the exception of the “Select Components” phase. Make sure to select all available fonts as shown below.
  2. For the fonts package, make sure the installation directory matches that of Xming itself (this should be “C:Program FilesXming” unless you changed this location in the Xming installation process). **NOTE: There may be an error alert that the installation already exists. If this happens, simply select “OK” or “Continue”
  3. You should now have an Xming icon on your desktop. Double-clicking this will start the X11 server and allow you to use X11.
  4. When the X11 server is running, you will see an “X” icon in your taskbar (near your clock). If you see this, you are ready to use X11-based applications.

Configure X11 Forwarding in Putty SSH Client

In the PuTTY configuration window, select “Connection->SSH->X11″ and make sure the “Enable X11 forwarding box is checked, then return to the Session category and click [Open] when you are ready to connect to the specified machine:

For information on installing PuTTY SSH, please visit the page at http://rcc.its.psu.edu/hpc/guides/putty/.

Configuring a Xlaunch file

  1. Go to Start -> Programs -> Xming > Xlaunch
  2. On the first screen, select “Multiple Windows.” This will make the remote application forwarding more like a normal windows application.
    On the next screen, it will ask how to start Xming. Select the “start a program” radio button, and click next.
  3. Where it says “Start Program”, type the name of the program you wish to start when you select the Xlaunch icon. If you wish to use this as a generic starting point for remote applications on the cluster, you may want to use xterm, as executing commands from within it will automatically forward those window as well. Other applications can be choosen as per requirement.
  4. In the dialog that says “Run Remote”, select “Using PuTTY (plink.exe)”. This will allow integration with the Portable Putty utility set you previously installed.
  5. In the box that says “Connect to computer”, type the hostname of the server you wish to connect to. See Connecting to Circe for login details for the Circe cluster.
  6. In the box that says “Login as user”, enter your username.
  7. Leave the password box blank, and click next.Click next on the next screen.
  8. Click the “Save Configuration” button on the next screen, and save the Xlaunch shortcut in an easily accessable location (such as your Desktop).
  9. You should be able to double-click on the created .xlaunch file to connect to the system. You’ll need to provide your password when you log in.

Configure SSHd for X11 forwarding

On the Linux machine, we have to alter the ssh daemon config file: /etc/ssh/sshd_config. Just ensure that it has the following:
# X11 tunneling options
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

If you already have similar parameters, don’t do anything. But if you had changed the config file, you have to restart ssh:
user@desktop:~$ sudo /etc/init.d/ssh restart

Running X11 Applications on Linux Server from Windows machine

Click the .xlaunch config created during the “Configuring a xlaunch file” phase and use the X11 applications from the windows machine.

The following is a screenshot of running xterm as default command and running a set applications like xeyes. xclock, firefox and gvim from xterm.

About these ads

Written by kiranmurari

January 22, 2010 at 7:48 am

Posted in X11 Forwarding, XMing

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 170 other followers

%d bloggers like this: