You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm currently receiving this error message while trying to start bash, tried using elevated and normal privilege
C:\WINDOWS\system32>bash
Error: 0x80070040
At first Bash was working. This is what I changed.
I tried setting the nameserver manually in /etc/resolv.conf, however then I received errors regarding not being able to open a socket when trying to use nslookup.
I rm'ed /etc/resolv.conf after this did not work - maybe this is causing the issue
I google'd a bit and read a suggestion to set the DNS server on the adapter directly within Windows. So I tried that. I closed bash. Then when I opened it again I started receiving error 0x80070040.
Now I've removed the DNS entry for that adapter and set it back to being set dynamically from DHCP.
But still I cannot start bash again, I only receive error 0x80070040.
I cannot find an obvious relevant event log relating to this. I've tried disabling the Windows subsystem for linux, rebooting, enabling, rebooting, still getting Error: 0x80070040
I checked in get-appxpackage but don't see anything obviously relating to BASH there. So I don't know how I can reinstall this.
I was able to reproduce the problem by again rm'ing /etc/resolv.conf (which is a symlink to /run/resolvconf/resolv.conf which is empty )
This again gives me the Error: 0x80070040
So for anyone out there - don't do this :)
Open %USERPROFILE%\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\etc\resolv.conf
Add this line ../run/resolvconf/resolv.conf
Reacted by synotna, Mahmoud Ahmed (محمود أحمد), nathkn, Kyle Underwood, Esteban Rodríguez Betancourt, JulianCDC, Maria Dimitrova, Jesus Basilio and Andrey Kuzmin
Very interesting. I got this problem when I was writing a C program, and forgot to close it before compiling -- and I guess it called some invalid code. It crashed my console and the other TTYs with it (my build view in Sublime Text crashed as well).
I had the same issue, edited : notepad C:\Users\<User>\AppData\Local\Packages\<My_Linux_dir>\LocalState\rootfs\etc\resolv.conf
and added : resolv.conf.d/head
As in my distro the resolv.conf configuration is in \etc\resolv.conf.d folder, where head was containing the nameserver entries.
Mahmoud Khalil (@mkhleel)Alex M (@ivalexm) I cannot find any linux related folder in the \AppData\Local\Packages
when I search bash, a red colored logo bash on ubuntu on windows appears and it works but doesn't works in cmd when I type bash
I need bash for intellij terminal
I was able to move %USERPROFILE%\AppData\Local\Packages\KaliLinux.54290C8133FEE_ey8k8hqnwqnmg\LocalState\rootfs\etc\resolv.conf to another folder and it started working (i.e. the symbolic link was re-created.)
I'm trying to use Ubuntu in Windows using Windows10 WSL feature.
I don't have windows store app in my machine. So, I have downloaded Ubuntu18.04 appx file and extracted the contents. Now, I have Ubuntu18.04.exe to run.
For the first time when I tried to run, it ran successfully. Then for some reason I was trying to uninstall and install it again. The extracted folder to which Ubuntu app is pointing got messed up. So, I have again extracted the files in the same folder. But now when I try to install it again it is throwing me this error.
I tried few online solution where it specified to uninstall Linux using this command:
lxrun /uninstall /full
Even for this I'm getting the same error:
lxrun /uninstall /full
Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution.
Distributions can be installed by visiting the Microsoft Store:
Activity
julianxhokaxhiu commentedon Apr 8, 2016
Can you try
then
maybe this can help you
ifmorrison commentedon Apr 8, 2016
Worked great, thanks!
I was able to reproduce the problem by again rm'ing /etc/resolv.conf (which is a symlink to /run/resolvconf/resolv.conf which is empty )
This again gives me the Error: 0x80070040
So for anyone out there - don't do this :)
m5lil commentedon Jan 2, 2018
Open
%USERPROFILE%\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\etc\resolv.confAdd this line
../run/resolvconf/resolv.confstanstrum commentedon Mar 1, 2018
Very interesting. I got this problem when I was writing a C program, and forgot to close it before compiling -- and I guess it called some invalid code. It crashed my console and the other TTYs with it (my build view in Sublime Text crashed as well).
ivalexm commentedon Mar 13, 2018
I had the same issue, edited :
notepad C:\Users\<User>\AppData\Local\Packages\<My_Linux_dir>\LocalState\rootfs\etc\resolv.confand added :
resolv.conf.d/headAs in my distro the resolv.conf configuration is in \etc\resolv.conf.d folder, where head was containing the nameserver entries.
sahareh commentedon Jul 7, 2018
Mahmoud Khalil (@mkhleel) Alex M (@ivalexm) I cannot find any linux related folder in the
\AppData\Local\Packageswhen I search bash, a red colored logo
bash on ubuntu on windowsappears and it works but doesn't works in cmd when I typebashI need bash for intellij terminal
ivalexm commentedon Jul 9, 2018
C:\Windows\System32\bash.exe {12345678-1234-5678-0123-456789abcdef} ~
qins commentedon Jul 12, 2018
Just create a blank text file:
%USERPROFILE%\AppData\Local\Packages\%YourLinuxUbuntuOrDebianCodeID%\LocalState\rootfs\etc\resolv.confDavGaz commentedon Aug 7, 2018
#2980 (comment)
decal commentedon Nov 7, 2018
I was able to move
%USERPROFILE%\AppData\Local\Packages\KaliLinux.54290C8133FEE_ey8k8hqnwqnmg\LocalState\rootfs\etc\resolv.confto another folder and it started working (i.e. the symbolic link was re-created.)priyanka2211 commentedon Jul 18, 2019
Hi,
I'm trying to use Ubuntu in Windows using Windows10 WSL feature.
I don't have windows store app in my machine. So, I have downloaded Ubuntu18.04 appx file and extracted the contents. Now, I have Ubuntu18.04.exe to run.
For the first time when I tried to run, it ran successfully. Then for some reason I was trying to uninstall and install it again. The extracted folder to which Ubuntu app is pointing got messed up. So, I have again extracted the files in the same folder. But now when I try to install it again it is throwing me this error.
I tried few online solution where it specified to uninstall Linux using this command:
lxrun /uninstall /full
Even for this I'm getting the same error:
lxrun /uninstall /full
Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
This will uninstall Ubuntu on Windows.
This will remove the Ubuntu environment as well as any modifications, new applications, and user data.
Type "y" to continue: y
Uninstalling...
Error: 0x80070002
Can someone please help to resolve this issue?
Thanks in advance

onomatopellan commentedon Jul 18, 2019
pri12 (@priyanka2211) See #2980
priyanka2211 commentedon Jul 19, 2019
Jonathan (@onomatopellan),
Got it working. I had two versions of Ubuntu, after completely uninstalling it. I was able to run without any error.
Thank you!