wsl2启动桌面_WSL2+Ubuntu20.04桌面功能配置

WSL2+Ubuntu20.04桌面功能配置

能使用系统自带的远程桌面就使用这个,子系统是重装后干净的系统

使用清华的软件源mirrors.tuna.tsinghua.edu.cn,备份软件源?不存在的

# sudo vi /etc/apt/sources.list use `:%d` command empty file contents

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse

添加完还是要记得apt update;apt upgrade更新并且升级下包

其次就是WSL自带的SSH有点的问题,要remove并重新install,然后修改配置文件中的端口并重启ssh服务 ,

因为默认的是22端口,但是windows的ssh服务默认也是22端口(如果不用Windows Terminal的话)。

sudo apt autoremove --purge openssh-server -y && sudo apt install openssh-server -y

sudo service ssh --full-restart

虚拟套件:ubuntu-desktop 2000MB+!!

解决WSL2不支持 systemd

git clone https://github.com/DamionGans/ubuntu-wsl2-systemd-script.git

cd ubuntu-wsl2-systemd-script/

bash ubuntu-wsl2-systemd-script.sh

重启子系统

安装桌面环境

sudo apt install ubuntu-desktop && sudo apt install -y xrdp 安装桌面套件和xrdp服务

systemctl status xrdp查看是否正常运行起来

sudo adduser xrdp ssl-cert && sudo systemctl restart xrdp 重启xrdp并开放

sudo ufw allow 3389 开启默认的3389端口

然后使用自带的远程桌面软件,ip填写localshot:3389 就ok

每次开机都需要sudo systemctl start xrdp

总结

用起来好卡。。不爽的很

参考

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值