WSL: Failed to install linux distro with error 0x8007023e

Environment

Windows build number: 10.0.19041.0
Your Distribution version: NA
Whether the issue is on WSL 2 and/or WSL 1: WSL 2

Steps to reproduce

I follow the docs to activate wsl 2 , then I am trying to install Linux distro , but failed with below error

Installing, this may take a few minutes… WslRegisterDistribution failed with error: 0x8007023e Error: 0x8007023e {Application Error} The exception s (0x

Expected behavior

Linux distro installed successfully.

Actual behavior

Installing, this may take a few minutes… WslRegisterDistribution failed with error: 0x8007023e Error: 0x8007023e {Application Error} The exception s (0x

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 41 (2 by maintainers)

Most upvoted comments

I got rid of 0x8007023e by following steps

  1. Disable all VM-like options (wsl, docker, vm platform, hyperv …) in Turn Windows features on or off
  2. Reboot
  3. Enable WSL and Virtual Machine Platform
  4. Reboot

I was investigating why this failed and messed up with my note taking as I fixed it without having to do all of this, but this does seem to work.

Try this. It’s more in-depth …

  • Make sure Virtualisation is enabled in BIOS.
  • Make sure the Windows Image and the OS are healthy. Follow these instructions for Windows 10: https://docs.microsoft.com/en-us/troubleshoot/windows-server/deployment/fix-windows-update-errors
  • Make a note/backup of ALL Hyper-V settings!
  • Remove all Virtual machine features. This being: Hyper-V, containers, Virtual Machine Platform, Windows Hypervisor Platform, Windows Sandbox and Windows Subsystem for Linux.
  • Reboot the computer!
  • Follow the manual WSL installation instructions provided by Microsoft as shown here: http://aka.ms/wslinstall
  • Reboot the computer!
  • Make sure that your Linux Distro converts to WSL2 if you want your Distro to operate under a full Linux Kernel.
  • There is no harm in invoking Windows Update at this point. I recommend you do.
  • Install the Windows Hypervisor Platform. (The likes of VMware and Virtual Box need it.)
  • No harm in rebooting the computer at this point.
  • No harm in invoking Windows Update at this point.
  • If you use it, install the Windows Sandbox feature and test it.
  • Finally install Hyper-V and put back all your required settings.

At this point everything, for me, started working.

I have noticed that on the completion of installing any of the virtualisation features, when invoking Windows Update then KB4592438 gets reapplied. If you wish, and maybe recommended, invoke Windows Update when you install a Windows Feature. That’s what I did. Installed a feature, rebooted and invoked Window Update. (I think the only one where I didn’t invoke Windows Update is when I installed the Windows Hypervisor Platform.)

Any update on this? In my case, I was able to successfully run the wsl2 Ubuntu for 3 days and then it started failing with the error code - 0x8007023e as below. Tried all the workarounds related to this error but no luck. Cant reinstall Windows as well. Tried reinstalling WSL completly but still its same issue

Installing, this may take a few minutes… WslRegisterDistribution failed with error: 0x8007023e Error: 0x8007023e {Application Error} The exception s (0x Press any key to continue…

I ended re-installing windows 😦 and then it worked

I got rid of 0x8007023e by following steps

  1. Disable all VM-like options (wsl, docker, vm platform, hyperv …) in Turn Windows features on or off
  2. Reboot
  3. Enable WSL and Virtual Machine Platform
  4. Reboot

Unfortunately this worked. Damnit.

I have been facing this issue on Windows 11. followed all the troubleshooting steps suggested here but none of them worked. MY specs are as follows:-

OS Name Microsoft Windows 11 Home Single Language Version 10.0.22000 Build 22000 Other OS Description Not Available OS Manufacturer Microsoft Corporation System Name D&^%$$&%&^%^ System Manufacturer Dell Inc. System Model Inspiron 7570 System Type x64-based PC Processor Intel® Core™ i7-8550U CPU @ 1.80GHz, 1992 Mhz, 4 Core(s), 8 Logical Processor(s) BIOS Version/Date Dell Inc. 1.21.0, 18-10-2021 SMBIOS Version 3.0 Embedded Controller Version 255.255 BIOS Mode UEFI BaseBoard Manufacturer Dell Inc. BaseBoard Product 06K08K BaseBoard Version A00 Platform Role Mobile Secure Boot State On PCR7 Configuration Elevation Required to View Windows Directory C:\WINDOWS System Directory C:\WINDOWS\system32 Boot Device \Device\HarddiskVolume3 Locale India Hardware Abstraction Layer Version = “10.0.22000.778” Total Physical Memory 15.8 GB Available Physical Memory 9.76 GB Total Virtual Memory 18.2 GB Available Virtual Memory 11.5 GB Page File Space 2.38 GB Page File C:\pagefile.sys Kernel DMA Protection Off Virtualization-based security Running Virtualization-based security Required Security Properties Virtualization-based security Available Security Properties Base Virtualization Support, Secure Boot, DMA Protection, UEFI Code Readonly, SMM Security Mitigations 1.0, Mode Based Execution Control Virtualization-based security Services Configured Virtualization-based security Services Running A hypervisor has been detected. Features required for Hyper-V will not be displayed.

After breaking my head on for hours, I tried the following solution at a hunch and it worked. I set the version of wsl to 1. wsl --set-default-version 1

After above operation completed successfully, wsl --install -d Ubuntu command worked like a charm.

I don’t know why it worked and why other solutions didn’t. Others who stumble onto this page may also try this before you resort to more desperate measures.

Thanks,

For whom it may help, the privateinternetaccess desktop app was causing this issue for me.

YESSSS!!! Worked with one strange minor twist I did prior to doing your recipe, so, whether it affected the outcome being positive is uncertain, as its possible it could have worked without enrolling in the Insider program. I am going to de-enroll and hopefully it will stick as the preview build will probably be trashed and rolled back. FWIW after enrolling in the insider program so I could drop in a preview build, se if that would resolve it, still no dice. Applied the recipe above and voile! AWESOME work and thank you very much for your master chef recipe to our salvation and sanity! 👍🏼 Side note, installing win-kex for kali had a few little nits and easy to resolve and find plenty of solutions online all saying the same thing, stop the vncservice and kill kali first, before rebooting, then relaunch into kex (KALI UI) worked perfectly. Hope you all had a HNY and staying safe and healthy!

For whom it may help, the privateinternetaccess desktop app was causing this issue for me.

Hmmm. This might be the same for me. I found that I could get it to work by following @Myron-S 's instructions, except for re-enabling hypervisor platform. I’m not doing anything with Virtual Box or VMware so I didn’t need it. I will test the PIA desktop app later when I’m back on my machine.

I am also facing this issue, no workaround. Any solutions?

image

At the same time this issue also affected my previous docker installations, and tried both with Docker Desktop 2.3.0.4 and Docker Desktop 2.0.0.3; but both returned different errors.

Docker Desktop 2.3.0.4 error:

System.InvalidOperationException:
Failed to deploy distro docker-desktop to C:\Users\Beatriz Salvado\AppData\Local\Docker\wsl\distro: exit code: -1
 stdout: {Application Error}

The exception s (0x
 stderr: 
   at Docker.Core.WslShortLivedCommandResult.LogAndThrowIfUnexpectedExitCode(String prefix, ILogger log, Int32 expectedExitCode) in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Core\WslCommand.cs:line 119
   at Docker.Engines.WSL2.WSL2Provisioning.<DeployDistroAsync>d__17.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 169
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.Engines.WSL2.WSL2Provisioning.<ProvisionAsync>d__8.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\WSL2Provisioning.cs:line 78
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.Engines.WSL2.LinuxWSL2Engine.<DoStartAsync>d__24.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.Desktop\Engines\WSL2\LinuxWSL2Engine.cs:line 94
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.TaskExtensions.<WrapAsyncInCancellationException>d__0.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\TaskExtensions.cs:line 29
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 67
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Docker.ApiServices.StateMachines.StartTransition.<DoRunAsync>d__5.MoveNext() in C:\workspaces\stable-2.3.x\src\github.com\docker\pinata\win\src\Docker.ApiServices\StateMachines\StartTransition.cs:line 92

Docker Desktop 2.0.0.3 error:

Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Generic failure 
at New-Switch, <No file>: line 121
at <ScriptBlock>, <No file>: line 411
   at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters) in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeClient.cs:line 36
   at Docker.Actions.DoStart(SynchronizationContext syncCtx, Boolean showWelcomeWindow, Boolean executeAfterStartCleanup) in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 92
   at Docker.Actions.<>c__DisplayClass19_0.<Start>b__0() in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 74
   at Docker.WPF.TaskQueue.<>c__DisplayClass19_0.<.ctor>b__1() in C:\workspaces\stable-18.09.x\src\github.com\docker\pinata\win\src\Docker.WPF\TaskQueue.cs:line 59

I was investigating why this failed and messed up with my note taking as I fixed it without having to do all of this, but this does seem to work.

Try this. It’s more in-depth …

  • Make sure Virtualisation is enabled in BIOS.
  • Make sure the Windows Image and the OS are healthy. Follow these instructions for Windows 10: https://docs.microsoft.com/en-us/troubleshoot/windows-server/deployment/fix-windows-update-errors
  • Make a note/backup of ALL Hyper-V settings!
  • Remove all Virtual machine features. This being: Hyper-V, containers, Virtual Machine Platform, Windows Hypervisor Platform, Windows Sandbox and Windows Subsystem for Linux.
  • Reboot the computer!
  • Follow the manual WSL installation instructions provided by Microsoft as shown here: http://aka.ms/wslinstall
  • Reboot the computer!
  • Make sure that your Linux Distro converts to WSL2 if you want your Distro to operate under a full Linux Kernel.
  • There is no harm in invoking Windows Update at this point. I recommend you do.
  • Install the Windows Hypervisor Platform. (The likes of VMware and Virtual Box need it.)
  • No harm in rebooting the computer at this point.
  • No harm in invoking Windows Update at this point.
  • If you use it, install the Windows Sandbox feature and test it.
  • Finally install Hyper-V and put back all your required settings.

At this point everything, for me, started working.

I have noticed that on the completion of installing any of the virtualisation features, when invoking Windows Update then KB4592438 gets reapplied. If you wish, and maybe recommended, invoke Windows Update when you install a Windows Feature. That’s what I did. Installed a feature, rebooted and invoked Window Update. (I think the only one where I didn’t invoke Windows Update is when I installed the Windows Hypervisor Platform.)

Holy s*** it worked. I think the problem is with the virtual box. we can’t install wsl2 after virtual box but vice versa is possible.

I was investigating why this failed and messed up with my note taking as I fixed it without having to do all of this, but this does seem to work.

Try this. It’s more in-depth …

  • Make sure Virtualisation is enabled in BIOS.
  • Make sure the Windows Image and the OS are healthy. Follow these instructions for Windows 10: https://docs.microsoft.com/en-us/troubleshoot/windows-server/deployment/fix-windows-update-errors
  • Make a note/backup of ALL Hyper-V settings!
  • Remove all Virtual machine features. This being: Hyper-V, containers, Virtual Machine Platform, Windows Hypervisor Platform, Windows Sandbox and Windows Subsystem for Linux.
  • Reboot the computer!
  • Follow the manual WSL installation instructions provided by Microsoft as shown here: http://aka.ms/wslinstall
  • Reboot the computer!
  • Make sure that your Linux Distro converts to WSL2 if you want your Distro to operate under a full Linux Kernel.
  • There is no harm in invoking Windows Update at this point. I recommend you do.
  • Install the Windows Hypervisor Platform. (The likes of VMware and Virtual Box need it.)
  • No harm in rebooting the computer at this point.
  • No harm in invoking Windows Update at this point.
  • If you use it, install the Windows Sandbox feature and test it.
  • Finally install Hyper-V and put back all your required settings.

At this point everything, for me, started working.

I have noticed that on the completion of installing any of the virtualisation features, when invoking Windows Update then KB4592438 gets reapplied. If you wish, and maybe recommended, invoke Windows Update when you install a Windows Feature. That’s what I did. Installed a feature, rebooted and invoked Window Update. (I think the only one where I didn’t invoke Windows Update is when I installed the Windows Hypervisor Platform.)

This solution works perfectly. Thanks.

For whom it may help, the privateinternetaccess desktop app was causing this issue for me.

Thought I’d update here. Confirming it is the PIA desktop app. When starting WSL for the first time after restart while connected to the VPN, it throws the RPC server unavailable. After disconnecting from the VPN, WSL launches and behaves normally, even after reconnecting. My solution is that whenever I need to start WSL (or do apt-get update/upgrade) I disconnect from the VPN, let WSL do its thing, then reconnect. I’d love to add WSL to the VPN bypass rules, however I can’t find the executable that it’s using to access the internet, I’ve already added my mintty terminal to them and I see no difference (external IP in WSL is still that of the VPN).

@ Myron-S, much appreciated the detailed step by step instructuions I will go through it step by step and let you know if it worked! That would be amazing!! @ gyk6985432 , Thanks for sharing your success with the approach proposed by Myron-S. Hoping I can replicate as same.

I was investigating why this failed and messed up with my note taking as I fixed it without having to do all of this, but this does sem to work work.

Try this. It’s more in-depth …

  • Make sure Virtualisation is enabled in BIOS.
  • Make sure the Windows Image and the OS are healthy. Follow these instructions for Windows 10: https://docs.microsoft.com/en-us/troubleshoot/windows-server/deployment/fix-windows-update-errors
  • Make a note/backup of ALL Hyper-V settings!
  • Remove all Virtual machine features. This being: Hyper-V, containers, Virtual Machine Platform, Windows Hypervisor Platform, Windows Sandbox and Windows Subsystem for Linux.
  • Reboot the computer!
  • Follow the manual WSL installation instructions provided by Microsoft as shown here: http://aka.ms/wslinstall
  • Reboot the computer!
  • Make sure that your Linux Distro converts to WSL2 if you want your Distro to operate under a full Linux Kernel.
  • There is no harm in invoking Windows Update at this point. I recommend you do.
  • Install the Windows Hypervisor Platform. (The likes of VMware and Virtual Box need it.)
  • No harm in rebooting the computer at this point.
  • No harm in invoking Windows Update at this point.
  • If you use it, install the Windows Sandbox feature and test it.
  • Finally install Hyper-V and put back all your required settings.

At this point everything, for me, started working.

I have noticed that on the completion of installing any of the virtualisation features, when invoking Windows Update then KB4592438 gets reapplied. If you wish, and maybe recommended, invoke Windows Update when you install a Windows Feature. That’s what I did. Installed a feature, rebooted and invoked Window Update. (I think the only one where I didn’t invoke Windows Update is when I installed the Windows Hypervisor Platform.)

Thank you so much, after two days this solved my problem finally

Any update on this? In my case, I was able to successfully run the wsl2 Ubuntu for 3 days and then it started failing with the error code - 0x8007023e as below. Tried all the workarounds related to this error but no luck. Cant reinstall Windows as well. Tried reinstalling WSL completly but still its same issue

Installing, this may take a few minutes… WslRegisterDistribution failed with error: 0x8007023e Error: 0x8007023e {Application Error} The exception s (0x Press any key to continue…

@mabusaa I have reinstalled the windows 10 and now it works. I suppose that error was because of unsuccessull updating to 2004

Not an option for me 😦