WSL 2:从Windows 10 Bash Shell运行图形化Linux桌面应用程序,“错误E233:无法打开显示”

问题描述 投票:0回答:1

如何从Windows 10的Bash Shell运行图形化Linux桌面应用程序?

首先,我按照here中所示的步骤安装了Windows Linux子系统(WSL),如下所示:

((1)已安装Windows 10 Pro Insider Preview内部版本19619。

((2)已安装Ubuntu Linux发行版。

((3)将发行版从WSL 1更改为WSL 2。

第二,要从Windows 10的Bash Shell启用图形化Linux桌面应用程序,我按照here所示执行以下步骤,如下所示:

((4)我安装了Xming的X服务器

((5)使用以下工具安装了基于GTK的图形化vim编辑器作为测试:

sudo apt-get install vim-gtk

((6)设置我的显示环境变量

export DISPLAY=:0

((7)启动应用程序

gvim

但是,这没有使应用程序吃饱饭,并且出现了以下错误:

E233: cannot open display
Press ENTER or type command to continue
E852: The child process failed to start the GUI
Press ENTER or type command to continue

知道为什么会发生此错误吗?

windows ubuntu windows-subsystem-for-linux xserver xming
1个回答
0
投票

这里有一个疑难解答部分,用于在wsl2上调试X11:

https://github.com/cascadium/wsl-windows-toolbar-launcher/blob/master/README.md#troubleshooting

端口转发与WSL1不同-您的Linux服务可以通过Windows的本地主机访问,但反之不再成立。

因此,您需要使用Windows主机的内部IP并调整防火墙以允许WSL网络通过。

© www.soinside.com 2019 - 2024. All rights reserved.