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

WslRegisterDistribution failed with error: 0x8000000d An illegal state change was requested. #4084

Open
ghost opened this issue Jun 5, 2019 · 44 comments
Labels
failure-to-launch failure to launch

Comments

@ghost
Copy link

ghost commented Jun 5, 2019

Please use the following bug reporting template to help produce issues which are actionable and reproducible, including all command-line steps necessary to induce the failure condition. Please fill out all the fields! Issues with missing or incomplete issue templates will be closed.

If you have a feature request, please post to the UserVoice.

If this is a console issue (a problem with layout, rendering, colors, etc.), please post to the console issue tracker.

Important: Do not open GitHub issues for Windows crashes (BSODs) or security issues. Please direct all Windows crashes and security issues to secure@microsoft.com. Ideally, please configure your machine to capture minidumps, repro the issue, and send the minidump from "C:\Windows\minidump".

Please fill out the below information:

  • Your Windows build number: (Type ver at a Windows Command Prompt)

Microsoft Windows [Version 10.0.18362.145]

  • What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)

I enabled the Windows Subsystem for Linux feature, rebooted, and then installed Ubuntu from the Microsoft Store. Upon launching Ubuntu, the following error message appeared:

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x8000000d
Error: 0x8000000d An illegal state change was requested.

I tried running wsl from a command prompt and it claimed no distribution was installed:

Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
  • What's wrong / what should be happening instead:

Ubuntu should have started successfully.

  • Strace of the failing command, if applicable: (If some_command is failing, then run strace -o some_command.strace -f some_command some_args, and link the contents of some_command.strace in a gist here).

N/A

See our contributing instructions for assistance.

@ghost ghost changed the title WslRegisterDistribution failed with error: 0x8000000d WslRegisterDistribution failed with error: 0x8000000d An illegal state change was requested. WslRegisterDistribution failed with error: 0x8000000d An illegal state change was requested. Jun 5, 2019
@EdManDev
Copy link

EdManDev commented Jun 6, 2019

i got the same problem

@craigloewen-msft
Copy link
Member

If you uninstall the Ubuntu app and then reinstall it do you get the same error?

And if you do, you can always try and verify and repair your disk image by running the following command in a command prompt window with admin privileges:

DISM /Online /Cleanup-Image /CheckHealth

If neither of those solutions work for you let me know and we can troubleshoot further!

@benhillis
Copy link
Member

Is it possible that you launched the Ubuntu application twice? Can you share the output of wslconfig.exe /list /all?

@geev-gv
Copy link

geev-gv commented Jun 12, 2019

passwd: password updated successfully Installation successful! To run a command as administrator (user "root"), use "sudo <command>". See "man sudo_root" for details.
Solution to the same problem on WoA10-1803 (on a Raspberry Pi3).
Uninstall 'Ubuntu 18.04', install Ubuntu App and then install Ubuntu 18.04. With the clock speed at 1.2GHz, WsL is now faster too...

@geev-gv
Copy link

geev-gv commented Jun 12, 2019

The repository 'http://ports.ubuntu.com/ubuntu-ports bionic-backports InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ports.ubuntu.com/ubuntu-ports bionic-security InRelease: Unknown error executing apt-key
How can one resolve this error?

@craigloewen-msft
Copy link
Member

Hi @gee-gv please open a separate issue for the error you're experiencing above with some reproducible steps so we can take a look at it!

@seekerlee
Copy link

seekerlee commented Aug 4, 2019

`Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x8000000d
Error: 0x8000000d ???????????

Press any key to continue...`

my issue


after reboot it resolved

@minorcong
Copy link

Is it possible that you launched the Ubuntu application twice? Can you share the output of wslconfig.exe /list /all?

maybe my problem is caused by this, then, how to clean the ubuntu in the first installation

wslconfig.exe /l /a
适用于 Linux 的 Windows 子系统:
Ubuntu-18.04

@minorcong
Copy link

Is it possible that you launched the Ubuntu application twice? Can you share the output of wslconfig.exe /list /all?

maybe my problem is caused by this, then, how to clean the ubuntu in the first installation

wslconfig.exe /l /a
适用于 Linux 的 Windows 子系统:
Ubuntu-18.04

it's resolved now, maybe wslconfig /t

@craigloewen-msft
Copy link
Member

@minorcong depending on your Windows version (works in 18362 and higher) you can run this command to remove a distribution easily:

wsl --unregister <Distroname>

If you're running a build that's earlier than 18362 you can use wslconfig /u <DistroName>

@bhill-17
Copy link

image
I've uninstalled and reinstalled the Ubuntu 16.04 app and rebooted my computer but I keep getting the same error when trying to run it. And I only have one application running. So what do I try now?

@oltip
Copy link

oltip commented Mar 13, 2020

I am facing the same issues after uninstalling Ubuntu 18.4 in Windows 10 and trying to re-install it.

I also tried to run all the commands suggested previously. But it doesn't work.

When I run this: PS C:\WINDOWS\system32> wslconfig.exe /list /all

I get this:

W i n d o w s S u b s y s t e m f o r L i n u x D i s t r i b u t i o n s :

U b u n t u

Any idea why I still run in this error:
Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x8000000d
Error: 0x8000000d An illegal state change was requested.

Press any key to continue...

@mathgim
Copy link

mathgim commented Mar 15, 2020

Same here!

@hsellik
Copy link

hsellik commented Mar 15, 2020

I also have the same issue for Ubuntu 18.04.

EDIT: Got it working
In my case, I updated Windows from 1903 to 1909.

I also ran "Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux" during the installation attempt, since I thought it is going to fail anyway, but it worked. Though, I still believe updating Windows was the solution for me.

@oltip
Copy link

oltip commented Mar 15, 2020

I solved the initial issue (after updating the Windows version to 1909),
but I am running into a new one.

Ubuntu 18.04 gets stuck in Windows 10 (version 1909). It either fails to initiate, or consumes a lot of CPU and gets stuck. I have a pc, Asus, with Intel i5 (8th generation) and 8 GB of RAM.

I have been using Ubuntu for year and had not faced any problem at all up to 4-5 days ago.

Is anybody else running into a similar issues?
Just to understand if it is a general issues or has to do with my personal pc.

@hsellik
Copy link

hsellik commented Mar 15, 2020

@oltip

TL;DR

  1. Search for "Turn Windows features on of off" from start menu
  2. Enable "Virtual Machine Platform"
  3. Restart
  4. Hopefully this will solve it

Longer version:
I think it's experienced by quite some people, but there seems to be an accepted solution provided here #4936 (comment) .

The most interesting thing about this for me is the following response:

The Virtual Machine Platform feature should not affect WSL1 at all. Especially on 1903/1909 WSL should have no ties to that feature at all.

So the "fix" mentioned above is actually a workaround for now. I provided a memory dump for them so hopefully they can figure this out and fix it.

@oltip
Copy link

oltip commented Mar 16, 2020

Wow. I have never seen such a precise and helpful reply, so first, let me thank you.

Even more importantly, the solution you proposed seems to work (I have been using Ubuntu for about half an hour).

Thank you so much @hsellik.

To anyone out there running into the same issues, @hsellik's suggestion will avoid you a lot of frustration. :)

@rezaei
Copy link

rezaei commented Mar 31, 2020

@oltip

TL;DR

  1. Search for "Turn Windows features on of off" from start menu
  2. Enable "Virtual Machine Platform"
  3. Restart
  4. Hopefully this will solve it

Longer version:
I think it's experienced by quite some people, but there seems to be an accepted solution provided here #4936 (comment) .

The most interesting thing about this for me is the following response:

The Virtual Machine Platform feature should not affect WSL1 at all. Especially on 1903/1909 WSL should have no ties to that feature at all.

So the "fix" mentioned above is actually a workaround for now. I provided a memory dump for them so hopefully they can figure this out and fix it.
@hsellik. it seams your suggestion working ... thank you so much

@faydogan
Copy link

@hsellik Thanks that worked for me to.

@yousefra
Copy link

yousefra commented Dec 1, 2020

I don't know what the problem was.
But for me, it's solved by running ubuntu terminal as administrator.

@therealkenc
Copy link
Collaborator

Please collect WSL logs and post the backlink to the feedback item here.

@MajorBarnulf
Copy link

MajorBarnulf commented Feb 7, 2021

hi, I am encountering the same issue with an arch based distro ( https://github.com/yuk7/ArchWSL )

E:\Arch>Arch.exe
Using: E:\Arch\rootfs.tar.gz
Installing...
ERROR:Installation Failed!
HRESULT:0x8000000d
Press any key to continue...

and when I want to list available distros:

E:\Arch>wsl -l
Le sous-système Windows pour Linux n'a pas de distributions installées.
Vous pouvez installer les distributions en visitant le Microsoft Store :
https://aka.ms/wslstore

french version of 'no distro installed'

tried :

  • updating windows
  • uninstall / reinstall WSL2 from the turn windows features on or off menu
  • install Virtual Machine Platform from the same menu
  • using wsl1
  • unregistering the distro, deleting files and downloading them again
  • (rebooting after each steps)

but nothing worked
( I am using windows 19041.746 )

EDIT:

the issue was that a failed installation of Debian messed up the windows registry, I had to manually clean it
now it works just fine

@H-111-di
Copy link

H-111-di commented Apr 4, 2021

hi, I am encountering the same issue with an arch based distro ( https://github.com/yuk7/ArchWSL )

E:\Arch>Arch.exe
Using: E:\Arch\rootfs.tar.gz
Installing...
ERROR:Installation Failed!
HRESULT:0x8000000d
Press any key to continue...

and when I want to list available distros:

E:\Arch>wsl -l
Le sous-système Windows pour Linux n'a pas de distributions installées.
Vous pouvez installer les distributions en visitant le Microsoft Store :
https://aka.ms/wslstore

french version of 'no distro installed'

tried :

  • updating windows
  • uninstall / reinstall WSL2 from the turn windows features on or off menu
  • install Virtual Machine Platform from the same menu
  • using wsl1
  • unregistering the distro, deleting files and downloading them again
  • (rebooting after each steps)

but nothing worked
( I am using windows 19041.746 )

EDIT:

the issue was that a failed installation of Debian messed up the windows registry, I had to manually clean it
now it works just fine

how did you clean the registry? I have the same problem here... And I had tried all the methods above...

@therealkenc therealkenc added the failure-to-launch failure to launch label Apr 5, 2021
@MrP-cpu
Copy link

MrP-cpu commented Apr 8, 2021

If you uninstall the Ubuntu app and then reinstall it do you get the same error?

And if you do, you can always try and verify and repair your disk image by running the following command in a command prompt window with admin privileges:

DISM /Online /Cleanup-Image /CheckHealth

If neither of those solutions work for you let me know and we can troubleshoot further!
not working sir

@LyndonZhang
Copy link

hi, I am encountering the same issue with an arch based distro ( https://github.com/yuk7/ArchWSL )

E:\Arch>Arch.exe
Using: E:\Arch\rootfs.tar.gz
Installing...
ERROR:Installation Failed!
HRESULT:0x8000000d
Press any key to continue...

and when I want to list available distros:

E:\Arch>wsl -l
Le sous-système Windows pour Linux n'a pas de distributions installées.
Vous pouvez installer les distributions en visitant le Microsoft Store :
https://aka.ms/wslstore

french version of 'no distro installed'
tried :

  • updating windows
  • uninstall / reinstall WSL2 from the turn windows features on or off menu
  • install Virtual Machine Platform from the same menu
  • using wsl1
  • unregistering the distro, deleting files and downloading them again
  • (rebooting after each steps)

but nothing worked
( I am using windows 19041.746 )

EDIT:

the issue was that a failed installation of Debian messed up the windows registry, I had to manually clean it
now it works just fine

how did you clean the registry? I have the same problem here... And I had tried all the methods above...

i try to search for something about "Ubuntu" in regedit then delete them manually, it worked!

@tusharsnx
Copy link

I got the same error after I installed the Ubuntu without turning on the required optional features in windows.
I fixed the issue by resetting the Ubuntu installation from app setting in windows settings.

@BoseSj
Copy link

BoseSj commented Aug 23, 2022

When I faced this:

I unregistered the Ubuntu-20.04 using wsl --unregister Ubuntu-20.04 and then uninstalled it from windows apps, when I then installed it again using wsl --install Ubuntu-20.04, it was downloaded while it was installing, I faced this problem. Then I tried to check the available distros in my system using wsl -l but i didn't find it, just installed Ubuntu-20.04 there.

How it worked out for me:

  • I unregistered and uninstalled it again.
  • I restarted my device then.
  • Installed it again using pwsh.
  • It's running fine now.

@megoRU
Copy link

megoRU commented Oct 6, 2022

  1. CMD wsl --install
  2. CMD: wsl --install -d Ubuntu-20.04 //any of the list

Preview:

image

Result:

image

@arjun-ms
Copy link

USE:
wslconfig.exe /u ubuntu
Then open again!

@Allancgx
Copy link

Allancgx commented Nov 3, 2022

Restarting the system fixed the issue for me. After restarting, I opened Ubuntu again and it continued the installation process and prompt username creation step

@itz-ja5p3r
Copy link

Finally i have found the best solution... Sorted 2 solution those who need help dm🧞‍♂✨

@itz-ja5p3r
Copy link

✅1000000% working
For every error✅💯
⚠️Follow my step carefully
1.Control panel → Program & features →🛡Turn windows features on or off → Now disable virtual machine platform, hypervisor platform, windows subsystem for linux →Ok →Restart now
2.uninstall Distro (kali,ubuntu,debian......),windows subsystem for linux update from 🛡uninstallor change a program
3.Now install kali from Microsoft store → Launch →Read the error msg in kali terminal it ask to enable subsystem platform
→Control panel → Program & features →🛡Turn windows features on or off → Now enable subsystem platform only → ok → Restart now
4.Again open kali terminal →Notice an another error ask to enable virtaul machine platform
→Control panel → Program & features →🛡Turn windows features on or off → Now enable virtual machine platform → Ok → Restart now
5.Open kali terminal →New error request to update wsl2 kernel
→Install it https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
6.Now close and Open the kali terminal wait for a long
Request to create username:💯💯💯💯💯

@HobaiRiku
Copy link

✅1000000% working
For every error✅💯
⚠️Follow my step carefully
1.Control panel → Program & features →🛡Turn windows features on or off → Now disable virtual machine platform, hypervisor platform, windows subsystem for linux →Ok →Restart now
2.uninstall Distro (kali,ubuntu,debian......),windows subsystem for linux update from 🛡uninstallor change a program
3.Now install kali from Microsoft store → Launch →Read the error msg in kali terminal it ask to enable subsystem platform
→Control panel → Program & features →🛡Turn windows features on or off → Now enable subsystem platform only → ok → Restart now
4.Again open kali terminal →Notice an another error ask to enable virtaul machine platform
→Control panel → Program & features →🛡Turn windows features on or off → Now enable virtual machine platform → Ok → Restart now
5.Open kali terminal →New error request to update wsl2 kernel
→Install it https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
6.Now close and Open the kali terminal wait for a long
Request to create username:💯💯💯💯💯

Some how, when i run into step 4, it keep show 0x8000000d ???????, then i do all the rest and

wsl --unregister Ubuntu
wsl --install Ubuntu

done!

@itz-ja5p3r
Copy link

✅1000000% working
For every error✅💯
⚠️Follow my step carefully
1.Control panel → Program & features →🛡Turn windows features on or off → Now disable virtual machine platform, hypervisor platform, windows subsystem for linux →Ok →Restart now
2.uninstall Distro (kali,ubuntu,debian......),windows subsystem for linux update from 🛡uninstallor change a program
3.Now install kali from Microsoft store → Launch →Read the error msg in kali terminal it ask to enable subsystem platform
→Control panel → Program & features →🛡Turn windows features on or off → Now enable subsystem platform only → ok → Restart now
4.Again open kali terminal →Notice an another error ask to enable virtaul machine platform
→Control panel → Program & features →🛡Turn windows features on or off → Now enable virtual machine platform → Ok → Restart now
5.Open kali terminal →New error request to update wsl2 kernel
→Install it https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
6.Now close and Open the kali terminal wait for a long
Request to create username:💯💯💯💯💯

Some how, when i run into step 4, it keep show 0x8000000d ???????, then i do all the rest and

wsl --unregister Ubuntu
wsl --install Ubuntu

done!

For me, --unregister command doesn't for kali wsl
So, i manually uninstalled wsl and reinstalled everything

@Romuelson
Copy link

Check in Windows Security -> App & Browser Control -> Exploit Protection Settings:

System Settings, Control Flow Guard (CFG): Use default (On)

Program Settings, there should be entries for:

  • C:\Windows\System32\vmcompute.exe
  • C:\Windows\System32\vmwp.exe

Both should have Control Flow Guard set to:

  • Override System Settings > On > Use Strict CFG

/* Enable Virtual Machine */
PowerShell: dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

/* Enable Windows Subsystem for Linux */
PowerShell: dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

/* Install WSL v2 */
Download

/* Set Default Version */
PowerShell: wsl --set-default-version 2

PowerShell: wsl --unregister Ubuntu
PowerShell: wsl --install -d Ubuntu

@DurvalPaicheco
Copy link

USE: wslconfig.exe /u ubuntu Then open again!

Work for me. Thanks

@HeriYantodotDev
Copy link

USE: wslconfig.exe /u ubuntu Then open again!

I tried to install wsl 2 on my old laptop, and encountered the problem above.
Your solution above is best of the best!

@ivanrusakov
Copy link

wslconfig.exe /u ubuntu

works for me either! thanks!

@yuwanlin
Copy link

#9338 (comment) work for me

@alexaQAi
Copy link

wsl --install -d name of install system
For example: wsl --install -d ubuntu 22.31
After open not ubuntu, find on your pc and open UBUNTU TSL
Try this

@hadoizz
Copy link

hadoizz commented Nov 2, 2023

this helped me to fix it just
wsl --list --all
wsl --unregister
then try kali it will work hope this helps

@donaldafeith
Copy link

For everyone who might have had the same problem that I did. It was docker using my WSL2. I uninstalled docker and it started working again. (You have to change the docker config so that it doesn't grab your WSL2 or else it acts funny like that.)

@Coding4Hours
Copy link

for me it was because my uninstall of kali-linux didn't finish

@dalaosec
Copy link

@minorcong depending on your Windows version (works in 18362 and higher) you can run this command to remove a distribution easily:

wsl --unregister <Distroname>

If you're running a build that's earlier than 18362 you can use wslconfig /u <DistroName>

great ,it worked for me

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

No branches or pull requests