HOW-TO: X11 forwarding с ssh, putty и XmingSolaris 10: советы и приёмы системного администрирования |
|
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, 21 April. 2006
Добавил Gleb Reys
в категории SysAdmin
Комментарии (19) Обратные ссылки (0) Select language: English
HOW-TO: X11 forwarding с ssh, putty и Xming
Эту связку я использую вот уже больше года, практически ежедневно - и дома, и на работе. Всё очень удобно, и, главное, совершенно бесплатно.
X11 Forwarding с ssh - это замечательная возможность, которая позволяет вам получить у себя на клиентском десктопе окно удалённо запускаемого графического приложения. Есть множество дорогих продуктов вроде Citrix, GoGlobal и XWin32, которые позволяют вам получать доступ к вашим удалённым десктоп-сессиям на Unix-серверах, но если всё, что вам нужно - это получить окошко какого-то приложения на вашем экране, то все эти продукты совершенно не нужны. А гораздо правильное будет использовать X forwarding и Xming. Xming - это порт X Windows для вашей настольной Microsoft Windows. По сути, это X-сервер, запускаемый прозрачно поверх вашего рабочего стола в MS Windows, что позволяет вам перенапралять графический вывод на удалённых Unix хостах, чтобы запускаемые там приложения отображались у вас на десктопе MS Windows. Xming - очень простая и удобная в использовании штука. Всё, что вам нужно - это скачать и установить дистрибутив с со страницы проекта на SourceForge: XMing @ SourceForge. После установки, я советую вам создать ярлык в панели быстрого запуска, и изменить нужным образом командную строку выполнения команды. Вот моя полная командная строка: "C:\Program Files\Xming\Xming.exe" :0 -clipboard -multiwindow -xkblayout us,ru -xkbvariant winkeys -xkboptions grp:ctrl_shift_toggle Как видно из примера, я использую две раскладки клавиатуры, и переключаюсь на русский язык с помощью Ctrl+Shift. Теперь, когда Xming у вас уже настроен, нужно позаботиться об ssh стороне вопроса. Нужно изменить конфигурационный файл вашего ssh-демона: /etc/ssh/sshd_config. Позаботьтесь, чтобы в нём была вот такая секция с подобными значениями: # X11 tunneling options X11Forwarding yes X11DisplayOffset 10 X11UseLocalhost yes Если у вас уже были подобные параметры, то ничего делать не нужно. Если же вы изменили этот файл конфигурации, то следует перезапустить ssh: bash-3.00# svcadm restart svc:/network/ssh Всё, что осталось теперь - это скачать замечательного клиента Putty, если вы его ещё не используете для ваших ssh-сессий. Взять Putty можно вот по этому адресу: Putty: a free telnet/ssh client. Я не буду подробно объяснять настройку Putty, это наверняка сделано до меня другими, но скажу лишь, что для X11 forwarding'а вам нужно пробраться в настройки программы (основное окно), выбрать там раздел Connection, потом SSH, потом X11, и в появившемся разделе отметить галочку Enable X11 Forwarding. Вот и всё. Желаю удачи! Обратные ссылки
URI этой записи для создания обратных ссылок (trackback)
Нет обратных ссылок
Комментарии
Показывать комментарии
(Как список | Древовидной структурой)
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. |




