Skip to content

Error: 0x80070040 #62

Closed
Closed

Description

@ifmorrison

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.

Any suggestions?

Thanks,

Activity

  1. julianxhokaxhiu commented on Apr 8, 2016

    @julianxhokaxhiu

    Can you try

    lxrun.exe /uninstall /full
    

    then

    lxrun.exe /install
    

    maybe this can help you

  2. ifmorrison commented on Apr 8, 2016

    @ifmorrison
    Author

    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 :)

  3. m5lil commented on Jan 2, 2018

    @m5lil

    Open %USERPROFILE%\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\etc\resolv.conf
    Add this line
    ../run/resolvconf/resolv.conf

  4. stanstrum commented on Mar 1, 2018

    @stanstrum

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

  5. ivalexm commented on Mar 13, 2018

    @ivalexm

    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.

  6. sahareh commented on Jul 7, 2018

    @sahareh

    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

  7. ivalexm commented on Jul 9, 2018

    @ivalexm

    C:\Windows\System32\bash.exe {12345678-1234-5678-0123-456789abcdef} ~

  8. qins commented on Jul 12, 2018

    @qins

    Just create a blank text file: %USERPROFILE%\AppData\Local\Packages\%YourLinuxUbuntuOrDebianCodeID%\LocalState\rootfs\etc\resolv.conf

  9. DavGaz commented on Aug 7, 2018

    @DavGaz
  10. decal commented on Nov 7, 2018

    @decal

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

  11. priyanka2211 commented on Jul 18, 2019

    @priyanka2211

    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
    ubuntu error

  12. onomatopellan commented on Jul 18, 2019

    @onomatopellan
  13. priyanka2211 commented on Jul 19, 2019

    @priyanka2211

    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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions