【WSL】ArchWSL 无法启动 wslg 提示 Error: Can't open display: :0

2024 年 9 月 13 日 星期五(已编辑)
/ ,
88

【WSL】ArchWSL 无法启动 wslg 提示 Error: Can't open display: :0

今天在家里的台式主机上也安装了 ArchWSL,但是在检查 wslg 是否可用时遇到了 Can't open display: :0 的报错,常规的解决方法都是适用于 Ubuntu WSL 的,ArchWSL 的解决方法比较特殊,这里记录一下,当然也可以去看 Github Issue 的原贴中也说了解决方法:Init /tmp/.X11-unix is overwritten by mounts

0x00 解决方法

创建一个 /etc/tmpfiles.d/wslg.conf 文件,并在其中写入以下内容:

#  This file is part of the debianisation of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.

# See tmpfiles.d(5) for details

# Type Path           Mode UID  GID  Age Argument
L+     /tmp/.X11-unix -    -    -    -   /mnt/wslg/.X11-unix

0x01 问题分析

暂时还没空写,等我有空就补完

使用社交账号登录

  • Loading...
  • Loading...
  • Loading...
  • Loading...
  • Loading...