Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An error occurred during installation. Error Code: 0x80070422 #8694

Open
Duy-Thanh opened this issue Aug 6, 2022 · 21 comments
Open

An error occurred during installation. Error Code: 0x80070422 #8694

Duy-Thanh opened this issue Aug 6, 2022 · 21 comments

Comments

@Duy-Thanh
Copy link

Version Information

  • Windows version: Microsoft Windows [Version 10.0.22621.232] (Windows 11 Pro 64-bit)

  • WSL Version: 2

  • WSL Kernel Version: 5.10.16

  • What error did I get: An error occurred during installation. Error Code: 0x80070422

  • Distribution I'm trying to install: Ubuntu

  • Command line used: wsl --install -d Ubuntu

Description of this error

I'm trying to install an Ubuntu distro to WSL. My CPU is Core i8, has virtualization support enabled, and followed the manual installation instructions at: https://docs.microsoft.com/en-us/windows/wsl/install-manual

When I run the command wsl --install -d Ubuntu, I get the following error:
An error occurred during installation. Distribution Name: 'Ubuntu' Error Code: 0x80070422

Soon after, a search took place and I learned that the disabled LxssManager service was causing this error (Link to article: #3815)

So I ran the following commands in order:

  • cmd.exe to enter Command Prompt
  • sc start LxssManager to start the LxssManager service

And this is what I get:

[SC] StartService FAILED 1056:

An instance of the service is already running.

It says the service is already running. And when I check in services.msc, it is indeed running. So I suspect that although the service is running, the WSL on my machine is not able to communicate with the service.

So I stopped the service, put it back to the DISABLED state, went into Windows Features to disable WSL, rebooted the machine, and turned WSL back on, then restarted the computer.

At this point, I tried running WSL, and it gave me error 0x80070422. This is understandable, since I'm leaving the LxssManager service in the DISABLED state.

Then I re-enable the service with the command: sc config LxssManager start=auto, and this is what I get:

C:\Users\Duy Thanh>sc config LxssManager start=auto
[SC] ChangeServiceConfig SUCCESS

C:\Users\Duy Thanh>

(Please note that I have disabled UAC on my computer, and run Windows Terminal as administrator. Windows Defender is also completely disabled using Group Policy and Registry, so there should be no conflict here)

I repeatedly run the following commands:

C:\Users\Duy Thanh>shutdown -r -t 00

And after reboot:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\Users\Duy Thanh>cmd.exe
Microsoft Windows [Version 10.0.22621.232]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Duy Thanh>sc stop LxssManager

SERVICE_NAME: LxssManager
        TYPE               : 20  WIN32_SHARE_PROCESS
        STATE              : 3  STOP_PENDING
                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

C:\Users\Duy Thanh>sc query LxssManager

SERVICE_NAME: LxssManager
        TYPE               : 20  WIN32_SHARE_PROCESS
        STATE              : 1  STOPPED
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

C:\Users\Duy Thanh>sc start LxssManager

SERVICE_NAME: LxssManager
        TYPE               : 20  WIN32_SHARE_PROCESS
        STATE              : 2  START_PENDING
                                (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x7d0
        PID                : 4152
        FLAGS              :

C:\Users\Duy Thanh>sc query LxssManager

SERVICE_NAME: LxssManager
        TYPE               : 20  WIN32_SHARE_PROCESS
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

C:\Users\Duy Thanh>

Now it's time for me to install my distro, and I verify the service is running, via the above commands:

C:\Users\Duy Thanh>wsl --install -d Ubuntu
Installing: Ubuntu
An error occurred during installation. Distribution Name: 'Ubuntu' Error Code: 0x80070422

C:\Users\Duy Thanh>

Still the error persists, I try again with the command:

C:\Users\Duy Thanh>wsl --update
Installing: Windows Subsystem for Linux
The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.

C:\Users\Duy Thanh>

Something went wrong, I decided to check the service again:

C:\Users\Duy Thanh>sc query LxssManager

SERVICE_NAME: LxssManager
        TYPE               : 20  WIN32_SHARE_PROCESS
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

C:\Users\Duy Thanh>

I tried going back to PowerShell, but nothing worked (Because I was still in the Command Prompt):

C:\Users\Duy Thanh>exit
PS C:\Users\Duy Thanh> wsl --install -d Ubuntu
Installing: Ubuntu
An error occurred during installation. Distribution Name: 'Ubuntu' Error Code: 0x80070422
PS C:\Users\Duy Thanh> wsl --update
Installing: Windows Subsystem for Linux
The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.
PS C:\Users\Duy Thanh> cmd.exe
Microsoft Windows [Version 10.0.22621.232]
(c) Microsoft Corporation. All rights reserved.

C:\Users\Duy Thanh>sc query LxssManager

SERVICE_NAME: LxssManager
        TYPE               : 20  WIN32_SHARE_PROCESS
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

C:\Users\Duy Thanh>

So what's going on in the end? I appreciate any help

@NickDeBeenSAE
Copy link

Firstly, there is no such CPU as a Core i8, so I'm assuming you meant i9.

The Feature of WSL is not enabled.

Please search Features and open Turn Features On or Off.

Find WSL, and click enable.

Enable the Hyper-V service while your at it.

Reboot, then try the installation again, then get back to me once done.

@Duy-Thanh
Copy link
Author

Duy-Thanh commented Aug 10, 2022

Firstly, there is no such CPU as a Core i8, so I'm assuming you meant i9.

The Feature of WSL is not enabled.

Please search Features and open Turn Features On or Off.

Find WSL, and click enable.

Enable the Hyper-V service while your at it.

Reboot, then try the installation again, then get back to me once done.

@NickDeBeenAIE Thank you for helping me. Maybe due to a typo, I mistyped 9 into 8. Sorry for the confusion.

Hyper-V enabled, WSL feature enabled, I also tried disabling and enabling them in Windows Features but still no effect

What's more, there are some additional details:

I manually installed Ubuntu using the Add-AppxPackage command via Powershell, all the setup went smoothly and the installation and setup for the first time ran without any errors.

Then I opened the Powershell command prompt (run as admin) and typed wsl, Ubuntu actually worked without any errors. Even all commands are perfectly executed in that Ubuntu WSL environment

However, statements where WSL takes arguments won't work, such as wsl --install -d Ubuntu or wsl --update and any other WSL command that takes arguments, will both return error 0x80070422 (with the command wsl --install -d Ubuntu) and the error message: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. (with the wsl --update command).

There is another version of WSL, the WSL Preview version available on the Microsoft Store. And since I'm in the Windows Insider program, I thought maybe the current WSL is not compatible so I installed the WSL Preview on the Store, but still the same error occurs. And when I remove WSL Preview and go to windows features turn off Hyper-V and WSL and turn it back on, the error persists.

But when I manually install the Ubuntu distribution using the Appx installation file, everything is back to normal as if nothing happened.

@NickDeBeenSAE
Copy link

NickDeBeenSAE commented Oct 11, 2022 via email

@DavidLee528
Copy link

I occured similar problem when i wsl.exe --update in Powershell in Windows Terminal with same error code Wsl/UpdatePackage/0x80070422.

I found the reason: AppX Service is disabled by my self on my Windows 10 because of the high CPU usage.

After changing the Start type of Service AppXSvc from disable to automatic, everything become normal.

Hope it is helpful.

@mehdiMj-ir
Copy link

I occured similar problem when i wsl.exe --update in Powershell in Windows Terminal with same error code Wsl/UpdatePackage/0x80070422.

I found the reason: AppX Service is disabled by my self on my Windows 10 because of the high CPU usage.

After changing the Start type of Service AppXSvc from disable to automatic, everything become normal.

Hope it is helpful.

Same problem here!

I have a Windows Server 2022, I use techcommunity.microsoft and it says to update my Win server, enable WSL and install my desired distro:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
wsl --install

But after enable WLS and reboot I couldn't install and had these errors:

wsl --install -d Ubuntu
Installing: Ubuntu
An error occurred during installation. Distribution Name: 'Ubuntu' Error Code: 0x8000ffff
wsl --install -d Ubuntu-20.04
Installing: Ubuntu 20.04 LTS
An error occurred during installation. Distribution Name: 'Ubuntu 20.04 LTS' Error Code: 0x8000ffff

I tried your comment wsl --update and now it start installing.

Screenshot_20230118_094117

@jkateva
Copy link

jkateva commented Jan 19, 2023

I had the same problem and running this in an elevated command prompt fixed the issue:

sc config wlidsvc start= demand

@alinpop
Copy link

alinpop commented Feb 16, 2023

for me it worked by downloading it from the Microsoft Store. I think Windows expects that you are logged in even if you run the script from the terminal.

@swingingsimian
Copy link

swingingsimian commented Mar 1, 2023

I seem to be suffering from the same issue. In my case it was triggered by updating WSL after being prompted there was an update available.

Running cmd .exe as admin I got LxssManager running again and configured to auto start, but the problems persists.

I have also tried disabling the WSL feature restarting and renabling.

Please find logs attached as per https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method

WslLogs-2023-03-01_10-26-44.zip

EDIT: Updating via the Microsoft Store also fixed this for me.

@rdavies3
Copy link

rdavies3 commented Mar 2, 2023

I get to put my self on the list. I had a perfectly working installation that was working with separate installs on a couple of different user accounts on Windows 10. I had some configuration annoyances with a domain based user account, so I had been running everything important out of a local account. I prematurely ran a gui app before installing some of the visual libraries on Ubuntu, and ever since I've been getting the The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. Error code: Wsl/0x80070422 error. I've tired removing and re-enabling the WSL feature. I've verified that the LsxxManager service is running and is configured to run automatically. I've tried installing Ubuntu from the store, I've ensured that the HyperV and VirtualMachine Platform features are also enabled. I'm not sure what's gone wrong or what other troubleshooting steps I might try.

@elvin-jatapp
Copy link

fix/update via Microsoft Store helps for me

@ahmedalzeer
Copy link

for me i was disabled all my windows updates when i enabled it again it's works fine

@Uj947nXmRqV2nRaWshKtHzTvckUUpD

for me it was the wlidsvc (Microsoft Account Sign-in Assistant). microsoft wants you to have an account so badly

@egeres
Copy link

egeres commented Jun 8, 2023

I'm stuck at:

C:\WINDOWS\system32> wsl --install -d "Ubuntu-22.04"
Installing: Ubuntu 22.04 LTS
An error occurred during installation. Distribution Name: 'Ubuntu 22.04 LTS' Error Code: 0x80070422

I tried disabling and re-enabling WSL, but didn't work

Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

And I can't use the store because I ran a debloater script to remove the unnecessary, when I click on the ubuntu product page it crases (thanks microsoft!)

@Uj947nXmRqV2nRaWshKtHzTvckUUpD
Copy link

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented Jun 8, 2023

check these required services running (able to run):

@Uj947nXmRqV2nRaWshKtHzTvckUUpD
Copy link

Uj947nXmRqV2nRaWshKtHzTvckUUpD commented Jun 8, 2023

you can also install wsl and a distro without wlidsvc service running:

https://github.com/microsoft/WSL/releases -> get for eg. Microsoft.WSL_1.2.5.0_x64_ARM64.msixbundle
https://github.com/WhitewaterFoundry/Fedora-Remix-for-WSL -> get for eg. Fedora-Remix-for-WSL-SL_38.0.0.0_x64_arm64.msixbundle

you can also install distros without wlidsvc service using wsl manager https://github.com/bostrot/wsl2-distro-manager

@Salvia79
Copy link

Salvia79 commented Dec 10, 2023

I tried the solutions provided in issues #3386 and #3815 , but they did not work. In the end, I uninstalled related apps such as Windows Subsystem of Linux and Ubuntu, then restarted and installed wsl again by command wsl --install -d Ubuntu, still it showed the same error code, with a Microsoft link this time followed Step 4 - Download the Linux kernel update package. With the instruction on the page (just install the wsl2 kernel update package), ubuntu was successfully installed and worked.
Notes:

  1. For LxSSManager service and Windows update, set their Startup Type to Automatic.
  2. Both the Windows subsystem of Linux and Virtual Machine Platform were turned off and then turned on again.
  3. My Windows version: Microsoft Windows [Version 10.0.22631.2792] (Windows 11 Home 64-bit)

Hope this may help.

@jadczak-sibel
Copy link

check these required services running (able to run):

Needing the "Microsoft Account Sign-In Assistant" to be enabled is mind boggling but solved my problem.

@AlexeyKupershtokh
Copy link

In my case the problem was that I don't have AppX installed.
so when I run

wsl --install -d Ubuntu

I get

Error code: Wsl/InstallDistro/0x80070422

The workaround that helped:
just use another way to download files that doesn't require AppX.

wsl --install -d Ubuntu --web-download

Hope this helps someone.

@dod0lp
Copy link

dod0lp commented Jul 9, 2024

Potential new fix:
I simply hadn't had enabled Microsoft Store Install Service, perhaps this will help someone who needs fix next. I hadn't seen this issue with services before, so I'm adding it here. Hope this helps someone.

@Yongna-Xing
Copy link

I manually installed Ubuntu using the Add-AppxPackage command via Powershell, all the setup went smoothly and the installation and setup for the first time ran without any errors.

Then I opened the Powershell command prompt (run as admin) and typed wsl, Ubuntu actually worked without any errors. Even all commands are perfectly executed in that Ubuntu WSL environment

However, statements where WSL takes arguments won't work, such as wsl --install -d Ubuntu or wsl --update and any other WSL command that takes arguments, will both return error 0x80070422 (with the command wsl --install -d Ubuntu) and the error message: The service cannot be started, either because it is disabled or because it has no enabled devices associated with it. (with the wsl --update command).

There is another version of WSL, the WSL Preview version available on the Microsoft Store. And since I'm in the Windows Insider program, I thought maybe the current WSL is not compatible so I installed the WSL Preview on the Store, but still the same error occurs. And when I remove WSL Preview and go to windows features turn off Hyper-V and WSL and turn it back on, the error persists.

But when I manually install the Ubuntu distribution using the Appx installation file, everything is back to normal as if nothing happened.

I ran into the same problem from wsl --install -d Ubuntu. Could you provide more information on how to install ubuntu using Add-AppxPackage command via Powershell?

@FabrizioWall
Copy link

for me it was the wlidsvc (Microsoft Account Sign-in Assistant). microsoft wants you to have an account so badly

This works for me, I also enabled all Hyper-V services in Services.msc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests