WSL: Wsl/ERROR_SERVICE_DOES_NOT_EXIST

Windows Version

Microsoft Windows [Version 10.0.19045.4651]

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

No response

Other Software

No response

Repro Steps

  1. Run a cmd prompt as administrator.
  2. wsl --status

Expected Behavior

A display of the status of Windows Subsystem for Linux.

Actual Behavior

Sixty seconds pass, then this error is printed:

The specified service does not exist as an installed service.
Error code: Wsl/ERROR_SERVICE_DOES_NOT_EXIST

This also happens if I run it in a regular (non-administrator) cmd prompt and it happens with most wsl commands, for example:

wsl
wsl -l -v

It does not happen with wsl --help (which prints a help message right away).

Diagnostic Logs

I ran the collect-wsl-logs.ps1 script in an admin PowerShell and ran wsl --status (in an admin cmd window) while collect-wsl-logs.ps1 was running. It said:

Get-WindowsOptionalFeature : Access is denied.
At C:\Users\AaronBrown.MACALLISTER\collect-wsl-logs.ps1:56 char:1
+ Get-WindowsOptionalFeature -Online > $folder/optional-components.txt
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-WindowsOptionalFeature], COMException
    + FullyQualifiedErrorId : Microsoft.Dism.Commands.GetWindowsOptionalFeatureCommand

Log collection failed to start (exit code: -2147024891), trying to reset it.
Couldn't start log collection (exitCode: -2147024891)
Log collection is running. Please reproduce the problem and once done press any key to save the logs.
Saving logs...
Logs saved in: C:\Users\AaronBrown.MACALLISTER\WslLogs-2024-08-05_16-35-22.zip. Please attach that file to the GitHub issue.

Here is that file:

WslLogs-2024-08-05_16-35-22.zip

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16

Most upvoted comments

@OneBlue, I believe the troubleshooter worked! I told it I was trying to uninstall WSL, it said it fixed the problem, then I was able to reinstall WSL.

A co-worker of mine pushed some security policy changes to my computer about the same time so it’s also possible that had to do with it.

Now when I run wsl --status I immediately get “Default Version: 2”. Thanks.

Thank you @arundelo. This is the root cause of the error you’re seeing:

DEBUG: Error 2219:  Database: . Invalid Installer database format
1: 2219 2:  3:  4:  
This installation package could not be opened. Contact the application vendor to verify that this is a valid Windows Installer package.
C:\WINDOWS\Installer\4f934.msi

It looks like the currently installed package is corrupted and can’t be removed.

One thing you can try is this: https://support.microsoft.com/en-us/topic/fix-problems-that-block-programs-from-being-installed-or-removed-cca7d1b6-65a9-3d98-426b-e9f927e1eb4d to help remove the old package

@OneBlue, for what it’s worth, C:\WINDOWS\Installer\4f934.msi is a binary file of about 135 megabytes. The timestamp is from a day a couple months ago when I installed Docker, got a bluescreen during the install, ran wsl --install (which gave me “Error: 0x80070424 The specified service does not exist as an installed service”), and uninstalled and reinstalled Docker.

I’ll try the troubleshooter at the link you gave, thanks.