dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
~> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
部署映像服务和管理工具
版本: 10.0.19041.3570映像版本: 10.0.19045.3570
启用一个或多个功能
[==========================100.0%==========================]
操作成功完成。
若要更新到 WSL 2,需要运行 Windows 10。
或 Windows 11
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
~> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
部署映像服务和管理工具
版本: 10.0.19041.3570映像版本: 10.0.19045.3570
启用一个或多个功能
[==========================100.0%==========================]
操作成功完成。
wsl --install
此命令将启用运行 WSL 并安装 Linux 的 Ubuntu 发行版所需的功能
#安装发行版wsl --install -d
Linux 发行版:
Ubuntu
Ubuntu 22.04 LTS
Ubuntu 20.04
Ubuntu 20.04 ARM
Ubuntu 18.04
Ubuntu 18.04 ARM
Ubuntu 16.04
Debian GNU/Linux
Kali Linux
SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server 15 SP2
SUSE Linux Enterprise Server 15 SP3
openSUSE Tumbleweed
openSUSE Leap 15.3
openSUSE Leap 15.2
Oracle Linux 8.5
Oracle Linux 7.9
Fedora Remix for WSL
安装完毕后需要重启
wsl --list --online
参考文档:https://learn.microsoft.com/zh-cn/windows/wsl/install-manual