WSL2 安装

简单安装WSL2

准备工作

下面两处打勾 [适用于 Linux 的 Windows 子系统] 和[虚拟机平台]

设置默认为WSL2

用管理员身份打开 powershell

1
$ wsl --set-default-version 2

下载Ubuntu

1
$ wsl --install -d Ubuntu

若出现报错例如:

1
Installing, this may take a few minutes... WslRegisterDistribution failed with error: 0x800701bc Err

LxssManager 服务修改为自动启动从服务中修改会提示“拒绝访问”,所以从注册表win + R -> regedit -> \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager -> 右键 Start 项 -> 将值修改为 2 再输入 wsl --update即可