wsl子系统的桌面,网上的很多教程,放的东西很多,感觉很繁琐,所以下定决心放弃了。 今天我给大家展示一个简单的实现。
准备工作
WSL不支持systemd,Gnome桌面基于systemd,所以首先解决这个问题。 参考: https://github.com/damiongans/Ubuntu-wsl2- systemd-script )
sudo apt update
sudo apt安装工具包
git clone https://github.com/damiongans/Ubuntu-wsl2- systemd-script.git
cd ubuntu-wsl2-systemd-script/
bash Ubuntu-wsl2- systemd-script.sh
可以重新启动子系统,也可以重新启动电脑。
开始操作(参考: https://developer.a liyun.com/article/764492 )。
安装Gnome桌面
sudo apt update
sudo apt install -y ubuntu-desktop
Xrdp安装
sudo apt install -y xrdp
sudo systemctl status xrdp
sudo adduser xrdp ssl-cert
sudo systemctl restart xrdp
请检查配置文件中的端口。 默认值: 3389 )
vim /etc/xrdp/xrdp.ini
防火墙配置
sudo ufw allow 3389
远程桌面连接
以下工具的优化安装
sudo apt install gnome-software
sudo apt install gnome-tweaks
sdoaptinstallgnome-shell-extensions
后面的,自己慢慢挥舞吧。