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 [closed]
Asked Answered
K

4

15

I'm trying to install again Ubuntu on my Windows 10 Home Version 20H2 OS Build 19042.685 using WSL2.

The problem is the WSL2 installation is not finished. I received the following message doing Step 5 - Set WSL 2 as your default version

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.

Previous steps done:

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>

Then I restarted Windows and

execute wsl_update_x64.msi
Keg answered 5/1, 2021 at 16:50 Comment(3)
Your title says that you receive the error when executing wsl --set-default-version 2, but the output you copied says that you just typed wsl. That would simply attempt to launch your default WSL instance, but you haven't installed one yet (that's step 6). Can you confirm that you are receiving the error when also typing wsl --set-default-version 2 and not just wsl?Almuce
Also, this would be better suited to Super User or Unix & Linux. Stack Overflow questions should be programming based.Almuce
I issues the 2 commands wsl --set-default-version 2 and wsl. They give me the same answer.PS 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.Keg
O
71

I had the same issue:

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.

The problem was Kaspersky. The solution is simple: open cmd.exe as administrator and run the following code

sc config LxssManager start=auto

Kaspersky will give you a pop-up about a potential thread. Tell Kaspersky to ignore the alert. Please don't click on "Fix it" button for Kaspersky or you will undo the solution.

That should fix it.

Overstrain answered 14/4, 2021 at 14:23 Comment(3)
Yes, Kaspersky was blocking it the whole time, therefore affecting Docker.Sato
Note: Use CMD, not powershell (sc is a apparently a command only for CMD), and open it as admin.Deepdyed
I returns error Set-Content : A positional parameter cannot be found that accepts argument 'start=auto'. even in the admin mode.Furred
C
9

Docans is right; running:

sc config LxssManager start=auto

in Command Prompt seems to fix the issue. However, you must run Command Prompt as an Administrator. I don't have enough reputation to comment or edit the post to clarify this so I have to make it a separate answer.

Collaborationist answered 4/9, 2022 at 0:45 Comment(0)
P
0

PS: Windows Command shell needs to be open with Admin privileges (Run as administrator)

Paramedic answered 17/6, 2021 at 8:53 Comment(1)
P.S. of what? You didn't write anything beforeReade
Z
0

After so Many hours of searching and research about WSL and docker and trying to re-install Windows Subsystem for Linux and Hyper-V and running different commands on terminal trying to install and update WSL to version 2 and Many other thing for past 24 hours. Here is the full documentation of what you should done for WSL to work properly.

  1. Press Start button and search for Turn Windows features off or on and open that baby then make sure these are checked:
    • Windows Subsystem for Linux
    • Virtual Machine platform
    • Windows Hypervisor platform
    • Hyper-V

The last two might not be related but I did it to make sure older version of docker and other applications that emulate a firmware works properly.

  1. Make sure virtualization is enabled in your bios.

  2. (!important) Make sure you have there Windows services On and not disabled

    • LxssManager
    • Windows Insider Service

There two are essential for WSL to work properly and I don't know why Microsoft don't document these properly that I have to spend 24 hours and I found a post in dockers official blog back in Jun of 2019 That said Windows Insider is Important for working of WSL.

Link to the blog post: https://www.docker.com/blog/docker-hearts-wsl-2/

Why ever Microsoft didn't mention that?

Zusman answered 20/8, 2024 at 2:49 Comment(1)
That blog post you linked is 5 years old, and from when WSL 2 required Windows Insider. It hasn't required Insider in, well, almost 5 years ;-). That said, if you are running an Insider Build, then I assume you do need the Windows Insider Server running.Almuce

© 2022 - 2025 — McMap. All rights reserved.