0%

Windows 10 WSL2安装Debian

启用相关特性

以管理员运行CMD,输入:

1
2
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Enable-WindowsOptionalFeature -Online -FeatureName VirtualMachinePlatform -NoRestart

之后重启Windows

安装WSL2 Debian

以管理员运行CMD,先测试网络是否联通:

1
wsl.exe --list --online

若输出无法解析服务器的名称或地址则说明无法访问raw.githubusercontent.com,解决方案详见我之前写的解决raw.githubusercontent.com无法访问的问题

确定能够访问后,运行如下命令:

1
wsl.exe --install --no-distribution

之后重启Windows

以管理员运行CMD,运行如下命令:

1
2
3
wsl.exe --set-default-version 2
wsl.exe --set-default Debian
wsl.exe --install --distribution Debian