Cannot open display ":0"

wslg 启动程序报错:

1
Cannot open display ":0"

参考 github 报错为:

1
X servers create their socket under /tmp/.X11-Unix. This directory must exist and must be linked to /mnt/wslg/.X11-Unix where WSLg built-in X server create it's socket.

当出现下面图形才行

image-20230105172458696

出现问题是没有 X0

img

image-20230106090628591

参考

Disabling WSLg (or using it together with X410) - X410.dev修改.wslconfig,然后重新启动 wsl,来进行删除和创建

修改.wslconfig

添加:

1
guiApplications=false

image-20230105174713200

1
2
 sudo rm -r /tmp/.X11-unix
sudo ln -s /mnt/wslg/.X11-unix /tmp/.X11-unix

重启进行删除。

Licensed under CC BY-NC-SA 4.0
最后更新于 Jan 06, 2025 05:52 UTC
comments powered by Disqus
Built with Hugo
主题 StackJimmy 设计
Caret Up