系统要求
- Windows 10 版本 2004 及以上(内部版本 19041 及以上)
- 或 Windows 11
- 64位系统
- 已开启虚拟化功能(BIOS中启用)
🚀 安装步骤
1. 以管理员身份打开PowerShell
- 右键点击开始菜单
- 选择"Windows PowerShell(管理员)"或"终端(管理员)"
2. 启用WSL功能
powershell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
3. 重启电脑
powershell
Restart-Computer
4. 设置WSL2
重启后,在管理员PowerShell中执行:
powershell
# 设置WSL2为默认版本
wsl --set-default-version 2
5. 下载Ubuntu 22.04
6. 更新WSL2内核组件
powershell
wsl --update
7. 安装Ubuntu 22.04
D:\Ubuntu22.04是系统要放置的盘,放在C盘后续容器出问题
在ubuntu-jammy-wsl-arm64-ubuntu22.04lts.rootfs.tar.gz文件所在目录下执行
powershell
wsl --import Ubuntu-22.04 D:\Ubuntu22.04 D:\Downloads\ubuntu-jammy-wsl-amd64-ubuntu22.04lts.rootfs.tar.gz --version 2
执行后会显示操作成功完成。
7. 进入系统
powershell
wsl -d Ubuntu-22.04
会显示
powershell
PS D:\Downloads> wsl -d Ubuntu-22.04
Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 6.6.87.2-microsoft-standard-WSL2 x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/pro
System information as of Thu Mar 19 18:02:24 CST 2026
System load: 0.22 Processes: 30
Usage of /: 0.1% of 1006.85GB Users logged in: 0
Memory usage: 6% IPv4 address for eth0: 172.26.38.244
Swap usage: 0%
This message is shown once a day. To disable it please create the
/root/.hushlogin file.
root@PC-20260318UDBG:/mnt/d/Downloads#