Note: X11 forwarding works fine if I use putty and X11 forwarding using localhost:0.0. I would like to get it to work using Windows 10 command line ssh. Here are my steps.
- My Windows 10 computer and my Ubuntu computer are on the same local network.
- I installed and ran Xming. The icon in my icon tray says Xming Server:0.0
- I open a command window (type
cmd) - I use
ssh -X mymachineand log in ok. - At my Ubuntu prompt, I type
export DISPLAY=localhost:0.0
xcalc
- I get the following message
No protocol specified
Error: Can't open display: localhost:0.0
- I tried other combinations (Note: Windows 10 computer is on 192.168.1.18)
export DISPLAY=localhost:0.0
export DISPLAY=192.168.1.18:0.0
export DISPLAY=192.168.1.18:0
export DISPLAY=10:0.0
export DISPLAY=10:0.0.1
I even tried typing the following in the Windows command window:
set DISPLAY=localhost:0.0
ssh -X mymachine
but Windows didn't like that. I also tried using Windows Powershell. Nothing worked. I kept getting the same message.
I finally figured it out. I used Putty again and checked the $DISPLAY variable and got:
I just used the value 10.0 and it worked for both the cmd-shell and the Powershell.
But get this ... I tried the same thing the next day (after a restart on both machines) and it did not work.
I used
ssh -X mymachineand logged in typedxcalcand got the same error message.(My $DISPLAY was set in my .bash_profile so I didn't need to reset it.)
I then tried Putty again, and it worked and $DISPLAY was set to localhost:10.0
I then returned to the open cmd-shell and typed
xcalcand it worked. I didn't do anything in that shell window prior. Here is the outputIt appears that Putty is doing something globally that has an effect on other shells without the need to reload. How is that so?