I am trying to use x11 apps on my Mac from WSL2, but whenever I ssh into the machine I get this warning:
X11 forwarding request failed on channel 0
And echo $DISPLAY
returns blank.
In the server I've tried editing the X11 options in sshd_config file, alternated between yes and no on X11 UseLocalhost
, edited AddressFamily
to inet, used export DISPLAY=localhost:0.0
. Nothing works.
So far I've managed to use X11 on the Windows machine where WSL is installed with VcXsrv, but never remotely from an external machine.
So I figured that what I was doing wrong was that I followed this guide : what this actually does is that when I ssh I'm connecting to Windows first, which then prompts the ubuntu shell (or something like that).
So I got rid of that configuration and set up connection directly to the Ubuntu ssh server, and presto, x11 apps work like a charm.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.