简体   繁体   English

x11 从 WSL2 转发到远程机器

[英]x11 forwarding from WSL2 to remote machine

I am trying to use x11 apps on my Mac from WSL2, but whenever I ssh into the machine I get this warning:我正在尝试从 WSL2 在我的 Mac 上使用 x11 应用程序,但是每当我通过 ssh 进入机器时,我都会收到此警告:

X11 forwarding request failed on channel 0

And echo $DISPLAY returns blank.并且echo $DISPLAY返回空白。

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 .在服务器中,我尝试编辑 sshd_config 文件中的 X11 选项,在X11 UseLocalhost上在 yes 和 no 之间交替, X11 UseLocalhost AddressFamily编辑为 inet,使用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.到目前为止,我已经设法在安装了 WSL 和 VcXsrv 的 Windows 机器上使用 X11,但从未从外部机器远程使用。

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).所以我认为我做错的是我遵循了这个指南:这实际上是当我 ssh 我首先连接到 Windows,然后提示 ubuntu shell(或类似的东西)。

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.所以我去掉了那个配置,直接建立到 Ubuntu ssh 服务器的连接,很快,x11 应用程序就像一个魅力。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM