【发布时间】:2021-01-05 16:50:27
【问题描述】:
我正在尝试使用 WSL2 在我的 Windows 10 Home Version 20H2 OS Build 19042.685 上再次安装 Ubuntu。
问题是 WSL2 安装未完成。 我在执行第 5 步时收到以下消息 - 将 WSL 2 设置为您的默认版本
PS C:\WINDOWS\system32> wsl
The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
之前完成的步骤:
PS C:\WINDOWS\system32> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Deployment Image Servicing and Management tool
Version: 10.0.19041.572
Image Version: 10.0.19042.685
Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.
PS C:\WINDOWS\system32> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Deployment Image Servicing and Management tool
Version: 10.0.19041.572
Image Version: 10.0.19042.685
Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.
PS C:\WINDOWS\system32>
然后我重新启动 Windows 并
execute wsl_update_x64.msi
【问题讨论】:
-
您的标题说您在执行
wsl --set-default-version 2时收到错误,但您复制的输出显示您刚刚输入了wsl。这只会尝试启动您的默认 WSL 实例,但您尚未安装一个(这是第 6 步)。您能否确认您在也输入wsl --set-default-version 2而不仅仅是wsl时收到错误? -
另外,这更适合Super User 或Unix & Linux。堆栈溢出问题应该基于编程。
-
我发出 2 个命令 wsl --set-default-version 2 和 wsl。他们给了我相同的答案。PS C:\WINDOWS\system32> wsl --set-default-version 2 服务无法启动,要么是因为它被禁用,要么是因为它没有与之关联的启用设备。