Windows 10 WSL2 安装Linux Xfce图形界面

一.更新ubuntu 18.04 LTS软件源,推荐使用国内的软件源

1、备份配置文件:

cp -a /etc/apt/sources.list /etc/apt/sources.list.bak

2、修改sources.list文件,将http://archive.ubuntu.comhttp://security.ubuntu.com替换成http://mirrors.huaweicloud.com,可以参考如下命令:

sed -i "s@http://.*archive.ubuntu.com@http://mirrors.huaweicloud.com@g" /etc/apt/sources.list
sed -i "s@http://.*security.ubuntu.com@http://mirrors.huaweicloud.com@g" /etc/apt/sources.list

3、执行apt-get update更新索引

二.安装Xfce和美化Xfce

1.安装命令

sudo apt update && sudo apt -y upgrade
sudo apt install xfce4 xfce4-terminal

2.安装主题Adapta Theme

sudo add-apt-repository -y ppa:tista/adapta
sudo apt update
sudo apt install adapta-gtk-theme

3.安装字体

sudo apt install fonts-roboto
sudo apt install fonts-noto

4.启用主题

  • [ Applications ] » [ Settings ] » [ Appearance ] » [ Style ] » Adapta-Nokto
  • [ Applications ] » [ Settings ] » [ Window Manager ] » [ Style ] » Adapta-Nokto

5.安装Icon

sudo add-apt-repository -y ppa:papirus/papirus
sudo apt update
sudo apt install papirus-icon-theme

6.启用Icon

[ Applications ] » [ Settings ] » [ Appearance ] » [ Icon ]

三.安装X410或VcXSrv,作为X Server Window

X410直接从Windows Store搜索“X410”安装试用,VcXSrv可以从https://sourceforge.net/projects/vcxsrv/获取安装

安装好后,启动软件

四.连接X Server Window

打开Ubuntu Bash窗口,输入:

export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0

startxfce4

Windows 10 WSL2 安装Linux Xfce图形界面_第1张图片

参考文章:

https://autoize.com/xfce4-desktop-environment-and-x-server-for-ubuntu-on-wsl-2/

https://token2shell.com/howto/x410/customizing-xfce-desktop-for-ubuntu-wsl/

你可能感兴趣的:(linux,WSL2,Ubuntu,GUI)