1. 安装在C盘的方法
以下教程安装在C盘
(254条消息) Win10下安装配置使用WSL2_RenLJ1895的博客-CSDN博客_win10 安装wsl2
2. 安装在非C盘的方法
(254条消息) win10安装子系统(wsl)到非C盘,其它盘的方法_Locutus的博客-CSDN博客_win10子系统安装到其他盘
(254条消息) WSL1升级至WSL2_goldVitaminC的博客-CSDN博客_wsl1升级到wsl2
2.1 我的安装过程:
下载好如下文件:
powershell管理员方式运行:
./ubuntu2004.exe
运行完成,查看版本号:
wsl -l -v
# 结果
NAME STATE VERSION
* Ubuntu-20.04 Stopped 1
修改win配置:
打开控制面版,查看方式选择大图标,再点击程序与功能—>启用或关闭Windows功能,检查下图中红框圈出内容是否均以打对勾;若没有,则需要打对勾并点击确定
重启,更新配置
下载版本更新包,并运行:
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
更新版本设置:
wsl --set-version Ubuntu-20.04 2
wsl -l -v
# 结果
NAME STATE VERSION
* Ubuntu-20.04 Stopped 2
使用一:下载mobaxterm,他自动适配wsl子系统
使用二:vscode
下载扩展 remote ssh,打开 wsl targets即可启动ubuntu系统
使用三:命令行启动
# 运行:
wsl --distribution Ubuntu-20.04
#或者
wsl -d Ubuntu-20.04
# 查看
wsl -l --running
Windows Subsystem for Linux Distributions:
Ubuntu-20.04 (Default)
# 停止
wsl -t Ubuntu-20.04
# 或者
wsl --terminate Ubuntu-20.04
更新源:
# 备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
# 打开
sudo vim /etc/apt/sources.list
# 将源文件内容全部注释,并添加以下任意源
# 阿里源
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
# 清华源
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security multiverse
# 保存,退出,更新源
sudo apt-get update
# 更新文件
sudo apt-get dist-upgrade
sudo apt-get upgrade
与windos文件系统的联系,该子系统已经自动挂在了win的文件系统,在/mnt下
以上参考如下教程:
(254条消息) Win10下安装配置使用WSL2_RenLJ1895的博客-CSDN博客_win10 安装wsl2
3. 配置桌面
3.1 vncviewer
(254条消息) win10用vncviewer远程登陆ubuntu桌面_vieo的博客-CSDN博客_vnc远程桌面 win10
3.1 方法二,用mobaxterm