微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

wsl --set-default-version 2 服务无法启动,要么是因为它被禁用,要么是因为它没有与之关联的启用设备

如何解决wsl --set-default-version 2 服务无法启动,要么是因为它被禁用,要么是因为它没有与之关联的启用设备

我正在尝试使用 WSL2 在我的 Windows 10 家庭版 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

解决方法

我遇到了同样的问题

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

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

应该可以解决

,

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。