安装 WSL2 系统很简单,打开 Windows Sub-System 特性,然后到 Microsoft Store 上选择自己喜欢的系统,点击安装就好。
但是如果要安装第二套系统,就需要自己自己来了。
到 https://cloud-images.ubuntu.com/releases/ 下载最新的 WSL 系统文件。
例如 https://cloud-images.ubuntu.com/releases/21.10/release/ubuntu-21.10-server-cloudimg-amd64-wsl.rootfs.tar.gz
运行一下命令导入 Ubuntu 的文件系统
wsl --import <Distribution Name> <Installation Folder> <Ubuntu WSL2 Image Tarball path>
例如
wsl --import ubuntu-2 "C:\Users\myname\WSL2\ubuntu2" "C:\Users\myname\Downloads\ubuntu-21.10-server-cloudimg-amd64-wsl.rootfs.tar.gz"
wsl -d <Distribution Name>