Tunneling Xwindows Applications Through SSH/PuTTY

I have been working the last few months with a client that is mostly a Linux shop.  As much as I love Linux, it’s stability, and robustness, there is one thing that can be a pain to operate.  Whenever you need to access a GUI on a remote machine, it can be a bit of an undertaking.  Unless you’re sitting at the console of the server itself, there are very few options available to gain access to Xwindows.  Most folks will resort to using the IP KVM functionality built into most servers (i.e. HP iLO, Dell DRAC, etc.).  Others may even look to installing VNC server or an equivalent.  To me, those both seem like sledge hammer solutions to something with a more elegant and light-touch approach.

Back in college (Georgia Tech) we had a couple of Sun mainframes that ran a CAD-like integrated circuit layout application called Cadence.  The only way (or so we thought) to gain access to the application was by going to one of the Sun workstation labs in the top floor of the College of Computing and logging in directly to the mainframes.  So many students complained about having to work so many long hours in the lab that the server administrators came up with a way for us to access Cadence remotely.  The solution leveraged a functionality called Xwindows (or X11) forwarding.  The concept is simple: leverage SSH to port forward the X11 protocol (XDCMP) back to your local desktop.  If using an SSH client on a Linux workstation/desktop, you’re done – the Linux OS will interpret the XDCMP packets natively and present the Xwindows-based application.  If using another operating system, you then need a 3rd party application that can translate this protocol.  For Windows, I typically use Xming.

To get this working for you…
1. Download and install Xming on your Windows machine. Take all of the defaults during the install. Choose to launch Xming at the end of the install. You’ll see a new icon appear in your taskbar. For you MAC folk, there are simplier ways than using Xming (I’ll let you just google for the answer – it’s readily available).
2. Launch PuTTy. Using the navigation tree on the left, go to Connection -> SSH -> X11. Click the check box to Enable X11 forwarding. In the text box for X display location, type “localhost:0”.
3. To test, login to a linux host of your choosing and run: ~$ xeyes This should launch a graphical set of eyes (that follow your mouse pointer) on your local windows host.

I used this method a lot to launch such programs as Qlogic SANsurfer or Oracle GUI configuration applications. It made things much easier for me.

Leave a Comment