我在 Windows 11 上使用 WSL2。我想systemctl在 Ubuntu 20.04 中运行该命令,但它给了我以下错误:
System has not been booted with systemd as init system (PID 1).
Can't operate. Failed to connect to bus: Host is down
Run Code Online (Sandbox Code Playgroud)
我该如何修复它?
我无法在 WSL 下运行 GUI 应用程序。首先,我尝试运行 Synaptic,但它显示以下消息:
Unable to init server: Could not connect: Connection refused
Failed to initialize GTK.
Probably you're running Synaptic on Wayland with root permission.
Please restart your session without Wayland, or run Synaptic without root permission
Run Code Online (Sandbox Code Playgroud)
然后我尝试运行gedit并得到了这个:
Unable to init server: Could not connect: Connection refused
(gedit:36): Gtk-WARNING **: 12:46:33.434: cannot open display:
Run Code Online (Sandbox Code Playgroud)
有人建议我可以通过远程桌面连接来使用它,但我希望它与系统集成。
我使用的是 Windows 11 WSLg(使用 Microsoft Store 中的 Windows Subsystem for Linux Preview 安装)和 Microsoft Store 中的当前 WSL Ubuntu 发行版。
如何启动xfce4或另一个 Ubuntu 桌面?
目前,apt install xfce4后跟startxfce4产生错误cannot open display: wayland-0+Failed to connect to session manager和一些其他输出。
xfce4在 Windows 10 WSL2 中,在 Windows 上安装并运行 VcXsrv 客户端后启动时没有遇到任何问题。据我了解,后者对于 Windows 11 WSLg 来说并不是必需的。
我可以毫无问题地启动独立的 x-windows 应用程序,例如xfce4-appfinder文件管理器和终端模拟器。thunar
windows-subsystem-for-linux ×3
boot ×1
gedit ×1
gui ×1
synaptic ×1
windows ×1
windows-10 ×1
xfce ×1
xubuntu ×1