77

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.

Bibz
  • 119
Neuquino
  • 1,023
  • 1
    if 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 Mar 14 '10 at 16:40
  • 3
    "I have a VM with RHEL 5 without an X server." you need an xserver of some sort to forward x. – Journeyman Geek Mar 15 '10 at 03:21
  • 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 Oct 05 '16 at 20:47

2 Answers2

92

You need a X server on your windows workstation. A couple popular options include:

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
  • 20,021
  • 4
    Even 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 Nov 21 '17 at 19:21
  • 3
    Note that Xming does work with Windows 10, although it's not specified on their webpage. – Joce May 25 '18 at 07:59
  • @Joce.. Agree.. Xming is amazing.. even though its a bit old.. – alpha_989 Aug 05 '18 at 16:50
  • You may need edit as admin: C:\Program Files\Xming\X0.hosts and add your VM IP address and restart xming. – Sergey Vlasov Oct 20 '19 at 20:28
  • My 2 cents: I tried the above methods. With Xming/putty I needed to put the localhost:0.0 in my config. This document worked for my setup[https://aws.amazon.com/blogs/compute/how-to-enable-x11-forwarding-from-red-hat-enterprise-linux-rhel-amazon-linux-suse-linux-ubuntu-server-to-support-gui-based-installations-from-amazon-ec2/] – Marinaio Oct 12 '21 at 13:52
1

you could use MobaXterm against the putty. https://mobaxterm.mobatek.net/download.html

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. – Community Dec 18 '21 at 09:36
  • Agree - MobaXterm was a quick solution, since Xming seems quite old and is not free to use (if one does not use it on a regular basis). Download, install, start SSH connection, then call the application. Note: there was a font-related error, so on the Host, set: export LC_ALL=C. Should do the job. Also, make sure that in /etc/ssh/sshd_config, X11Forwarding yes is set. – Ingmar Sep 19 '22 at 10:25