1.bios 开启虚拟化
2.开启win10系统的虚拟化支持WSL
控制面板,开启windows功能 1.hyper-V 2.适用于linux的windows子系统 3.虚拟机平机
也可以使用如下命令开启windows功能:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
3.wsl2需要开启虚拟化
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
如果报错 0x80370102
开机启动虚拟化 bcdedit /set hypervisorlaunchtype auto
开机关闭虚拟化 bcdedit /set hypervisorlaunchtype off
4.重启
5.下载内核,并安装
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
6.设置版本为version2
wsl --set-default-version 2
7.去microsoft store下载发行版
或wsl --list --online 查询可用的发行版 wsl --install 安装