Wednesday, September 23, 2009

Remote X11 an old linux feature that can help make a seamless envyronment

What is remote-X you ask?

Its a tool I have been using for years that can make multi system administration, testing, access a easy task.

The basics of how it works is this, Remote X11 forwarding is as it sounds, you can redirect the visual portion of linux apps over the network via your favorite SSH client. This works from both another linux client OR from a WINDOWS machine!

Why would you use this?
If you are like me and need to use tools from both the windows and linux world to do your job it can make things easy for gaining access to thoes tools.

Using me as an example I run Windows server 2008 as my base desktop OS and run several debian virtuals at home and the office (or on the laptop itself using vmware server) and just run the graphical apps remotely

I will note that this access method is not really designed for WAN access or in high latency environments, if that is what you are looking for there are other tools to accomplish this. The advantage of this tool is really that it is integrated and that it does the equivalent of seamless windows (so it is only the application that pops up)

How to:
Configure the server:

Step one is to configure the server to send its X11 information over tssh, with debian has this on automatically some other distro's necessitate modifying /etc/ssh/sshd_config


The line you need to make sure is in there and uncommented is

X11Forwarding yes

At that point your machine should be setup to forward X11

One caviat that I  have found also is ssh as the user that you want to execute the application as, X11 gets confused by su and switching to another user, it does not know how to forward the display through the other session.


Client side:
Linux
This is the easy one simply add a -X flag to your ssh session

ssh -X yourserver

Windows
You will need only 2 things to acomplish this
1) SSH client that does remote X11 forwarding, I use putty
2) An X server, I prefer Xming (Cygwin can do this)

With Xming you will only need Xming and Xming fonts

At that point simply run Xming (it will work in the background quietly no prompts or other information) and make sure your putty session is configured as follows.



The enable x11 forwarding checkbox must be checked, at that point save your session or connect as is without saving it.






At this point you are good to go, any application you launch from the SSH session will launch locally



In my example here I launched iceweasel from my debian virtual, it is a simple example but possibly a useful one (IE trying to download a file or directory directly to your server but is on a site that uses JAVA to initiate a download instead of actually getting a URL for wget or links)

I also use it for tools like when I am network simulating with NS2 or want to use XChat or any number of a dozen tools that sometimes have windows ports sometimes not.


Conclusion:
Remote X11 forwarding is a useful tool in seamless administration between multiple linux and windows/linux environments and can get you access to your tools in a seamless way that can look act and feel like a local application on operating systems that may not have access to the tool directly (or with more difficulty)

Comments:
Awesome tutorial..thanks :o)
 
My pleasure, if you have any idea's for something you would like more of a tutorial on feel free to let me know I am always looking for new topics to develop around.

I have an extensive home lab and sometimes the things I use every day are something that would help users
 

Post a Comment



Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]