microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.4k stars 819 forks source link

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

Open ghost opened 5 years ago

ghost commented 5 years ago

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:

Microsoft Windows [Version 10.0.18362.145]

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

Ubuntu should have started successfully.

N/A

See our contributing instructions for assistance.

EdManDev commented 5 years ago

i got the same problem

craigloewen-msft commented 5 years ago

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 commented 5 years ago

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

geev-gv commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

`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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

@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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

Same here!

hsellik commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@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 https://github.com/microsoft/WSL/issues/4936#issuecomment-595951087 .

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 commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

@hsellik Thanks that worked for me to.

yousefra commented 3 years ago

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

therealkenc commented 3 years ago

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

MajorBarnulf commented 3 years ago

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 :

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 commented 3 years ago

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...

MrP-cpu commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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:

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

Preview:

image

Result:

image

arjun-ms commented 2 years ago

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

Allancgx commented 1 year ago

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 commented 1 year ago

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

itz-ja5p3r commented 1 year ago

✅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 commented 1 year ago

✅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 commented 1 year ago

✅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 commented 1 year ago

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:

Both should have Control Flow Guard set to:

/ 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 commented 1 year ago

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

Work for me. Thanks

HeriYantodotDev commented 1 year ago

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 commented 1 year ago

wslconfig.exe /u ubuntu

works for me either! thanks!

Sanford284 commented 1 year ago

https://github.com/microsoft/WSL/issues/9338#issuecomment-1733943420 work for me

alexaQAi commented 1 year ago

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 commented 12 months ago

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

donaldafeith commented 10 months ago

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 commented 3 months ago

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

dalaosec commented 3 months ago

@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

zhygit2020 commented 3 months ago

@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>

Thanks!

immmor commented 2 months ago

USE: wslconfig.exe /u ubuntu Then open again! Got a new error: Error code: WslConfig/Service/WSL_E_DISTRO_NOT_FOUND

gaoqiangks commented 1 month ago

With wsl --install Ubuntu-24.04, I got the same problem. However, wsl --install Ubuntu-24.04 --web-download works well.