1.首先保证你的Windows版本能够下载wsl2
参考网址:https://docs.microsoft.com/zh-cn/windows/wsl/install-win10
2.进入windows store 下载ubuntu20.04us
3.打开wsl,设置用户名,密码
4.下载xfce4
下载链接:https://sourceforge.net/projects/vcxsrv/
5.设置ubuntu20.04
先更新源:https://zhuanlan.zhihu.com/p/142014944
5.1 安装中文与字体
sudo apt-get install language-pack-zh-hans
sudo apt-get install font-manager
5.2 配置语言环境
sudo fc-cache -fv
sudo dpkg-reconfigure locales
5.3安装xfce4 桌面环境
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install xfce4
xfce4 选第一个
5.4 在powershell中输入ipconfig查看wsl的虚拟ip地址
5.5在bashrc中设置export
vim bashrc
在最后输入
export DISPLAY=192.168.0.1:0
输入完,保存,退出
刷新
source ~/.bashrc
6.设置xfce4
参考网址:https://autoize.com/xfce4-desktop-environment-and-x-server-for-ubuntu-on-wsl-2/
参考网址:https://blog.csdn.net/Alisebeast/article/details/106680267
7.启动
startxfce4