【问题标题】:wsl --set-default-version 2 The service cannot be started, either because it is disabled or because it has no enabled devices associated with itwsl --set-default-version 2 服务无法启动,或者因为它被禁用或者因为它没有与之关联的启用设备
【发布时间】: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 UserUnix & Linux。堆栈溢出问题应该基于编程
  • 我发出 2 个命令 wsl --set-default-version 2 和 wsl。他们给了我相同的答案。PS C:\WINDOWS\system32> wsl --set-default-version 2 服务无法启动,要么是因为它被禁用,要么是因为它没有与之关联的启用设备。

标签: failed-installation wsl-2


【解决方案1】:

我遇到了同样的问题

C:\WINDOWS\system32> wsl --set-default-version 2
The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.

问题是卡巴斯基。解决方法很简单 打开cmd.exe,运行如下代码

sc config LxssManager start=auto

卡巴斯基会给您一个关于潜在线程的弹出窗口。告诉卡巴斯基忽略警报。请不要点击卡巴斯基的“修复”按钮,否则您将撤消解决方案。

应该可以解决的

【讨论】:

  • 是的,卡巴斯基一直在阻止它,因此影响了 Docker。
  • 感谢您的提示,wsl 在 w21h1 上工作并在 kaspersky cloud 上被忽略
  • 注意:使用 CMD,而不是 powershell(sc 显然是一个仅用于 CMD 的命令),并以管理员身份打开。
  • 很好的解决方案 - 卡巴斯基一直是罪魁祸首。谢谢Docans。
  • 谢谢!它也帮助了我。您是如何找到解决方案的? :)
【解决方案2】:

PS:Windows Command shell 需要以管理员权限打开(以管理员身份运行)

【讨论】:

  • P.S.什么?你之前什么都没写
猜你喜欢
  • 1970-01-01
  • 2016-06-24
  • 2018-05-06
  • 2013-11-25
  • 1970-01-01
  • 2020-09-05
  • 2014-04-11
  • 1970-01-01
  • 2011-06-01
相关资源
最近更新 更多