Wsl2 Ubuntu20.04安装图形化界面

今天搞了好久,按照下面的教程配置界面

Xfce4 Desktop Environment and X Server for Ubuntu on WSL 2

但是,就一直不成功,后来发现原来是电脑的防火墙没有关闭,主机可以ping通wsl2,但反之失败。关闭防火墙之后就可以初始化桌面了。

几个关键坑:

1. 报错:/usr/bin/startxfce4: X server already running on display 172.17.194.1:0

刚开始没有关闭防火墙的时候,只报这个错误,但明明只开了一个X Server,却一直报错。

解决方法:就是关闭防火墙之后,虽然还是报这个错,但桌面出来了。【具体原因不详】

2. 初始化界面之后,窗口报一堆warning,界面刚开始有点丑,后来需要配置一直panel1/2的尺寸大小和位置,或者直接关闭,就会好看一些。以下是配好的桌面。


_IceTransmkdir: Owner of /tmp/.ICE-unix should be set to root
gpg-agent[4046]: WARNING: "--write-env-file" is an obsolete option - it has no effect
gpg-agent: a gpg-agent is already running - not starting a new one

(xfce4-session:4020): xfce4-session-WARNING **: 16:01:51.973: gpg-agent returned no PID in the variables
xfsettingsd: No window manager registered on screen 0.
xfce4-panel: No window manager registered on screen 0. To start the panel without this check, run with --disable-wm-check.
No window manager registered on screen 0. To start the xfdesktop without this check, run with --disable-wm-check.
Tracker-Message: 16:01:57.546: Set scheduler policy to SCHED_IDLE
Tracker-Message: 16:01:57.546: Setting priority nice level to 19
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
Tracker-Message: 16:01:57.562: Set scheduler policy to SCHED_IDLE
Tracker-Message: 16:01:57.562: Setting priority nice level to 19

** (xiccd:4183): WARNING **: 16:01:57.575: EDID is empty

** (xiccd:4183): CRITICAL **: 16:01:57.585: failed to create colord device: failed to obtain org.freedesktop.color-manager.create-device auth

** (update-notifier:4215): WARNING **: 16:01:57.920: already running?

** (light-locker:4234): ERROR **: 16:01:57.932: Environment variable XDG_SESSION_PATH not set. Is LightDM running?

(nm-applet:4197): nm-applet-WARNING **: 16:01:57.957: NetworkManager is not running
 

3. 启动Xlaunch的时候,一定要勾选“Disable access control”,否则桌面无法初始化成功

Wsl2 Ubuntu20.04安装图形化界面_第1张图片

 

你可能感兴趣的:(攻略)