How to use X11 forwarding with PuTTY

64

17

I have a VM with RHEL 5 without an X server. My host has Windows 7.

I need to connect to the VM and redirect the X11 output of the commands to my host.

I know that if my host were a GNU/Linux machine it would be as easy as ssh -X .

I'm using PuTTy to connect by SSH to the VM, I tried enabling X11 forward option in PuTTY config, but nothing happened.

Have you ever done this? I'm quite advanced with GNU/Linux, but a newbie with this toy of Winbug$ 7.

Neuquino

Posted 2010-03-14T15:56:53.100

Reputation: 885

1if you've enabled putty's X11-forwarding option, you're halfway there. that's all you need on the PuTTY side; RHEL is good to go; now you need an X server to display to. (Windows is not an X-server.) Cygwin and Xming both provide free x-servers for Windows, but i don't know how well they work on Win-7. there are commercial options as well. – quack quixote – 2010-03-14T16:40:15.383

3"I have a VM with RHEL 5 without an X server." you need an xserver of some sort to forward x. – Journeyman Geek – 2010-03-15T03:21:53.013

Here is a decent guide in case the accepted answer isnt clear as to what you need to do with Xming/Xlaunch: http://www.seas.upenn.edu/cets/answers/x11-forwarding.html

– dhaupin – 2016-10-05T20:47:47.297

Answers

77

You need a X server on your windows workstation. I prefer and regularly use Xming on my Windows 7 system. You need your SSH server to have the X11Forwarding yes set in the sshd_config. It also needs at least the xauth binary/package, but you may want to install your distrobutions version of X11 base clients.

In putty all you should have to do check the Enable X11 forewarding box under Connections\SSH\X11 in your putty connection.

putty x11 settings

Putty documentation for X11 forwarding

Man pages for sshd/sshd_config

Zoredache

Posted 2010-03-14T15:56:53.100

Reputation: 18 453

2Even though XMing shows me that it's display 0:0 on my system, when I filled in localhost:0:0 to the "X display location" field, the forwarding did not work. Just leaving this field empty is the best thing you can do ;) – Martin Pecka – 2017-11-21T19:21:10.630

1Note that Xming does work with Windows 10, although it's not specified on their webpage. – Joce – 2018-05-25T07:59:32.890

@Joce.. Agree.. Xming is amazing.. even though its a bit old.. – alpha_989 – 2018-08-05T16:50:13.517

You may need edit as admin: C:\Program Files\Xming\X0.hosts and add your VM IP address and restart xming. – Sergey Vlasov – 2019-10-20T20:28:53.520