Friday, December 24, 2010

X11 Forwarding With Putty Using Xming

X11 forwarding with SSH

X11 Forwarding with ssh is a wonderful feature which allows you get windows of a remotely started applications shown on your own desktop. For Windows, there are lots of pretty good albeit expensive products like Citrix, GoGlobal and XWin32, which allow you access your remote Unix desktop sessions. But in reality, if you don’t need any sessions but only want to remotely start an application and get a window from it on your desktop, you won’t need any of these expensive products – the easiest will be to use X11 forwarding and Xming.

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 Unix servers and therefore see these applications windows on your MS Windows desktop.

Xming is very simple and easy to use. All you have to do is download its distribution archive from the project’s page on SourceForge: XMing @ SourceForge.

Configure SSHd for X11 forwarding
Now that you have Xming installed, start it and it’s time to take care of the ssh side of things. 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 to change the config file, it’s time to restart ssh:

solaris# svcadm restart svc:/network/ssh

All that’s left now is to download the wonderful free Putty client, that is if you’re not using it yet. You can get it here:
Putty: a free telnet/ssh client.

I won’t go into all the Putty configuration details, I’ll only mention that for X11 forwarding, you have to do the following: in the main configuration window of Putty (you get it when you start Putty), select Connection section, then SSH, then X11, and make sure you tick the Enable X11 Forwarding option and if the Xserver and putty are running on the same machine then enter "localhost:10.0" in the text box provided.

Once logged on using putty check whether the DISPLAY variable has been set, if it is not set then set the DISPLAY variable.

For bash/ksh Shell
export DISPLAY=localhost:10.0


For C Shell
set DISPLAY=localhost:10.0

Then check whether we can able to stimulate the X11 program , enter xclock to check.
if we have set all the necessary configurations properly then it will forward the GUI clock to the Windows desktop.. which means now our linux/solaris server will forward the GUI applications to our windows desktop.
also check this page and configure you remote host depending on you server.

No comments:

Post a Comment