1. 更新 WSL

wsl --update

2. 确保使用的是 WSL 2

wsl -l -v

如果显示为 WSL 1,可以通过以下方式转换:

wsl --set-version <发行版名称> 2

3. 启用相关功能

确保 Hyper-V 和虚拟机平台启用:

dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
dism.exe /online /enable-feature /featurename:Microsoft-Hyper-V-All /all /norestart

然后重启电脑。