WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Error: 0x80070040

Open MupEHcEH opened this issue 8 years ago • 4 comments

Hello, I receive below error message when trying to run bash on windows 10. Tried running it as admin - same error.

C:\WINDOWS\system32>bash Error: 0x80070040 Press any key to continue...

This was working before, only thing i remember changing was to create a user account for RSA authentication to a Cisco device, but as far as I remember I was still able to launch it after. There is similar topic https://github.com/Microsoft/WSL/issues/62

Tried uninstall and re-install ubuntu sub-system - still getting same error. Also installed openSUSE and it works, but I have never used it and I'm not comfortable with it.

Any suggestions?

Thanks,

MupEHcEH avatar Feb 25 '18 12:02 MupEHcEH

Also receive this since a few days ago. Haven't really done anything special that could cause this, but I can supply necessary logs to try and find the problem.

bogdan-calapod avatar Apr 16 '18 11:04 bogdan-calapod

ok, this worked for me, and allowed me to reinstall the ubuntu distro.

in cmd

  1. you can see the list of installed distros: wslconfig /l

  2. delete distro for the list wslconfig /u ubuntu

  3. try to run ubuntu distro installer "Installing, this may take a few minutes... Installation successful!..."

Error: 0x80070040 is gone!!!

DavGaz avatar Aug 07 '18 06:08 DavGaz

Encountered similar issue before (Error: 0x80070040) and it was fixed by the following:

c:> bash.exe Error: 0x80070040

List all distributions

c:> wslconfig /l Windows Subsystem for Linux Distributions: Legacy (Default) Ubuntu-16.04

Set ubuntu as default

c:> wslconfig /setdefault Ubuntu-16.04

test-run bash. No error is displayed

c:> bash.exe username@pc-abc:[/mnt/c]:

List again and Ubuntu is set as default

c:> wslconfig /l Windows Subsystem for Linux Distributions: Ubuntu-16.04 (Default) Legacy

Uninstall Legacy

c:> wslconfig /u Legacy Unregistering...

c:> wslconfig /l Windows Subsystem for Linux Distributions: Ubuntu-16.04 (Default)

I don't know if it was caused by the very early legacy version of Ubuntu distribution which was uninstalled uncleanly... even though I installed Ubuntu 16.04 via Windows store later. The steps above are simply removal of the "legacy" one. Hope it also works for you.

jw-redpanda avatar Nov 11 '18 03:11 jw-redpanda

As mentioned above, using wslconfig is the easiest way to resolve this issue. The error you're running into means the distribution failed to register. wslconfig /u Legacy will unregister the legacy version you have. You can use /s to set the default distribution to your desired one

tara-raj avatar Nov 13 '18 18:11 tara-raj