HOW-TO: X11 forwarding using ssh, putty and XmingSolaris 10: tips and tricks for system administration |
|
Sponsored LinksКатегорииLinksUnix Tutorial
Personal Development Ruslan Valiev Solaris Performance Team Damien Farnham Fintan Ryan Nicky Veitch Niall Mullen Sean McGrath DTrace Bryan Cantrill Brendan Gregg ZFS Tim Foster General Ben Rockwood Learning Solaris 10 Privacy policy |
Friday, April 21. 2006HOW-TO: X11 forwarding using ssh, putty and Xming
I've been using this combination on a daily basis for more than a year now, and I can't stress enough how really useful it is. I use it both at home and at work, and everything is very easy and - most importantly - absolutely free.
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. After you install it, I recommend you have a quickstart panel shortcut created for it, and have your command line altered to something like this: "C:\Program Files\Xming\Xming.exe" :0 -clipboard -multiwindow 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: bash-3.00# 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. That's it, you're good to go! Good luck! Trackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
Hi, I tried the X11 forwording and it work fine, now I need to start in putty the whole graphical enviroment with the graphical login manager. What I'm supposer to run in putty?
Thank for you reply
Hi there!
Theoretically, you could run something like gnome-session there, but it causes Xming crash on my machine. Other products I've mentioned in my article - Citrix, GoGlobal or Xwin32 - will serve your purpose much better. Sorry I couldn't be of more help! Gleb
gnome-session will work if you run Xming in single-window mode. startkde works too if you have kde installed
gnome-session or startkde (if you have kde installed) will wokr if Xming is run in single window mode. You can use the Xlaunch utility to set your options in A GUI dialog and can save the session settings.
I haven't seen in any "tutorials" about Xming and putty about X0.hosts. I couldn't get it working before I added the remote host to this file (it's in Xming's installation directory, add a new line with the IP)
Hi there,
Thanks for the tip! Can you tell more about your experience? The procedure in this how-to is a complete one, so if you follow it step-by-step, it will work without X0.hosts. Maybe something to do with particular Putty settings? Gleb
Thanks for the help and tutorial. Everything worked great.
As an aside, The XO.hosts file is used if you don't specify X11 Forwarding or aren't using SSH. That is, if you are using straight telnet. Typically, people issue a command from there XServer terminal window "xhost +" which basically means allow everyone access. Thanks again. Great Tutorial. I was dreading having to install all of cygwin as I have in the past. Eric
Hi Eric,
Glad to hear you've found this how-to useful! And yes, I did a bit of research myself and you're absolutely right about the XO.hosts file. Thanks! Gleb
Thanks for a great tutorial. It works!
However. On my set up it is veeeery veeery sloooowwwww (we are talking about 7 minutes to load Firefox and once loaded it's unusable... The computer I am connecting to is my home PC running on a broadband connection of 4Mb (D/L) and 384 (U/L). The computer I am connecting from is my work laptop connected wirelessly to a T1 network. Can I expect no better or is there anything I can do to speed things up? Thanks in advance Oh. P.s. Can I run XMing from a USB stick or do I have to have it installed on the local machine? Thanks again...
Hi Arthur,
My apologies for such a long time to reply... Lost a few notifications from this blog, so never got a chance to read them. There's definitely something wrong. ssh compression enables a much better throughput, and it sounds like you simply need to sort out the routing between your two machines. For instance, I'm doing the same now and then - connect to a home PC from work - and it's much faster. Not lightning-fast now, but quite usable. Yes, I believe you can run XMing from anything you like - USB definitely works. See here: http://swik.net/Xming Hope this helps. See you!
I have been using PuttY for a number of years now & I'm still loving it! :-).
However, I have just started using Xming, after discovering from your page that it's free. I have now integrated both PuttY/SSH & Xming. I even Telnet'ed from the Windows XP command line (cmd) and everything works ok (once I exported my DISPLAY). I run Graphical Tools like Solaris Management Console, Veritas Enterprise Administrator (VEA) client, PerfMeter, Firefox (installed on my Solaris box) and several games. Tell you what, the whole setup works great ..., and besides it's so simple/easy to setup. Thanks once again for the notes on your page. We use Hummingbird Exceed at work and I have been looking for a cheap/free solution that'd enable me to connect to my Solaris 10 and RHEL 4.0 servers from my notebook PC running Windows Vista. This is an excellent "FOC" solution! C h e e r s, Anthony
Hey Anthony,
Glad you found this useful! Yes, the same here: I've got a choice of rather expensive tools for remote desktop sessions management, but when it's not about a session but only about running a single command for 5 minutes, nothing beats Putty/Xming. Good luck!
Hi and thanks for the tutorial!
It works like a charm for me with my debian machine. All the best /Felix Sweden
Hi,
I just installed Xming.. But it doesnt seem to work for me. Here is what i did I started xming server. opened a new TELNET session. updated DISPLAY setenv DISPLAY localhost:0.0 Then tried to start some graphical appn. But doesnt find the display. My question is whether xming works for plain telnet.. (not ssh) ? Thanks Kumaran
Hi Kumaran,
You need to reflect your windows workstation name in the DISPLAY variable, place it instead of the localhost. The reason it works in SSH is because X11 forwarding feature of it takes care of DISPLAY forwarding.
Excellent tutorial :)
I have run into a problem however. I use XLaunch and specify one window, and then use "startkde" from PuTTY. KDE starts and initially appears to work, but very quickly gets bogged down and hangs to the point where I need to stop Xming. When stopping Xming it alerts me there are 15 (or 17, or 20 etc) clients connected, when there should only be one. I find that starting Xming with multiwindow, and then running individual apps in their own windows seems to work much better. I'd like to be able to run KDE too however. What must I do?
Доброго времени суток!
Столкнулся с неожиданной проблемой при использовании сего замечательного инструмента - при вызове java-приложений совершенно неадекватно ведет себя клавиатура, возможность печатать появляется только в случае выделения некоторого имеющегося блока текста, при этом работают только буквенно-цифровые клавиши и пробел, либо необходимо встать мышью на любое поле. Ничего подобного в обычных приложениях не наблюдается.
Excellent !! It worked in one go. Thanks
But theoretically how things are happening , how display of Unix is forwarded to windows. why DISPLAY value is set to localhost:10.0 ? localhost is the unix machine itself.
Hi Rishi,
The reason it's localhost:10.0 is because it's a standard display variable configured in /etc/sshd/sshd_config file for your SSH server. The following 3 parameters control it all: X11Forwarding yes #X11DisplayOffset 10 #X11UseLocalhost yes So the X11 display offset is 10 which results in your localhost:10.0 It's just the way your SSH server works when dealing with X11 forwarding. |





