2

I currently am using Cmder (which is effectively conemu) to SSH into a university cluster from my Windows machine. I want to enable x-forwarding, and I have Xming installed. I followed the instructions here, which I swear I've used before but doesn't seem to work right now. Specifically, I type

DISPLAY=localhost:0.0;export DISPLAY;

once I open up a Cmder terminal (with Xming already loaded), but the error I get back is

Error: cannot open display: localhost:0.0

despite Xming saying it is Xming server:0.0. Any suggestions? I should add that the x-forwarding works perfectly fine with MobaXterm, but I'd prefer to stick with Cmder.

Community
  • 1
  • 1
Argon
  • 405
  • 1
  • 6
  • 18

4 Answers4

2

The issue was that I was setting the display variable on the client server, not the host computer. On my Windows machine, I opened Xming and then did

set DISPLAY=127.0.0.1:0.

Afterwards, I SSH'd into the client server via

ssh -X myname@address.

Now everything works as intended.

Argon
  • 405
  • 1
  • 6
  • 18
  • Please not that this answer is for cmd.exe. If you're using Powershell, use `$env:DISPLAY=localhost:0.0` instead. The idea is that `DISPLAY` needs to be an environmental variable in order to get sent, and the `set` command means something different when using Powershell. The `$env` prefix before the variable name would appear to make `DISPLAY` an environmental variable. – Top Cat Jan 07 '18 at 01:08
0

I have exactly the same problem. However, I have observed that if I open up a Putty session with x11 forwarding set, then add the display number to my ConEmu session that is ssh'd into the Linux box, then x11 works from ConEmu. Weird.

It is an inconvenient workaround at best.

  • I've just discovered the same thing when launching the SSH executable from the XLaunch program - seems to open its own terminal from which I can launch X11 applications, but it also enables me to launch X11 applications from ConEmu. Not really ideal and requires quite a lot of clicks before I can get anything done. Did you find a solution to this? – Top Cat Jan 06 '18 at 23:15
  • I've sorted it - anyone needing help please read Argon's answer. – Top Cat Jan 07 '18 at 01:03
0

I made it work for me.

Even so Xming was telling me "localhost:0.0", after connecting to the my server (using the "-x" ssh's option) I rather did :

DISPLAY=:10.0;export DISPLAY;
Renaud
  • 1,290
  • 8
  • 8
0

The following worked for me:

export DISPLAY=127.0.0.1:0
ssh -XC <hostname>
Christopher Markieta
  • 5,674
  • 10
  • 43
  • 60