以管理員身份運(yùn)行cmd
wsl --install
image.png
wsl --set-default-version 2
image.png
"D:\Downloads\Docker Desktop Installer.exe" install --installation-dir="D:\Docker\Docker" --windows-containers-default-data-root="D:\Docker\Docker\data" --wsl-default-data-root="D:\Docker\Docker\wsl"
源
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"registry-mirrors": [
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com",
"https://mirror.baidubce.com",
"https://docker.mirrors.ustc.edu.cn",
"https://cr.console.aliyun.com",
"https://mirror.ccs.tencentyun.com"
],
"experimental": false
}
啟用功能
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
設(shè)置默認(rèn)版本
wsl --set-default-version 2
手動下載分發(fā)版本
https://learn.microsoft.com/zh-cn/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package