小编Wil*_*lli的帖子

WSL2 GUI 不工作

我正在尝试让 GUI 与 WSL2 一起使用,但我尝试的任何方法都不起作用。

  1. 我关闭了家庭网络的防火墙(仅用于测试)。
  2. 我使用以下选项启动 Vcxsrv:多个窗口、显示编号:-1、不启动客户端、剪贴板(带有主要选择)、本机 OpenGL 和禁用访问控制。
  3. 在Ubuntu中,我输入:export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0
  4. 然后我也输入:export LIBGL_ALWAYS_INDIRECT=1

完成此操作后,我尝试执行一些曾经在 WSL1 下运行的程序。

在 的情况下nemo,我收到以下错误:

Unable to init server: Could not connect: Connection refused
Could not parse arguments: Cannot open display:
Run Code Online (Sandbox Code Playgroud)

当尝试运行时gedit,我收到以下错误:

Unable to init server: Could not connect: Connection refused

(gedit:6704): Gtk-WARNING **: 01:07:05.762: cannot open display: 172.19.64.1:0
Run Code Online (Sandbox Code Playgroud)

输入echo $DISPLAY产生以下输出:172.19.64.1:0

我还卸载了 Ubuntu,手动删除了 AppData 中的残留内容,并重新安装了 Ubuntu。如果这一点很重要:我没有创建 UNIX 帐户,而是使用 root(在重新安装 Ubuntu …

linux gui ubuntu windows-10 windows-subsystem-for-linux

4
推荐指数
2
解决办法
5万
查看次数