WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Error 0x80070003 after manually installing/uninstalling when launching bash.exe

Open TotomInc opened this issue 8 years ago • 8 comments

  • Your Windows build number:

    • Microsoft Windows [version 10.0.17134.112]
  • What you're doing and what's happening:

Everything have been running on an elevated cmd/powershell.

  1. I manually installed WSL without Windows Store with this answer on SO (it was a really bad idea).
  2. bash.exe working well at the moment (created a user and apt-get update)
  3. Tried to uninstall it with lxrun /uninstall /full.
  4. Throw an error 0x80070003 for uninstall, as well when I start bash.exe.
  5. Deleted all files related to Ubuntu/Canonical stuff.

After that, I tried to install it with lxrun in hope to get rid of the error:

  1. lxrun /install /y: installation ok, didn't asked for the creation of a user.
  2. bash.exe still broken but works fine when I start Bash on Ubuntu on Windows from Start Menu.

I think something messed up from the beginning when I tried to manually install WSL and now my installation is semi-broken.

I restarted my computer between some tasks and also tried to restart LxssManager service.

  • What's wrong / what should be happening instead:

    • bash.exe should run WSL properly and not give Error 0x80070003

TotomInc avatar Jun 24 '18 12:06 TotomInc

use wslconfig /u <distro-name> to uninstall that distro. And delete this registry Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss.

Biswa96 avatar Jun 24 '18 13:06 Biswa96

I don't recommend manually deleting any registry state.

benhillis avatar Jun 24 '18 14:06 benhillis

So, I have done what @Biswa96 said, now when I run bash I don't get the error anymore but instead ask me to download WSL. Seems to be OK.

However, when I run lxrun /uninstall /y or lxrun /uninstall /full /y I got an error 80070002. Of course I restarted the computer after doing Biswa's steps.

Is this intended since I have uninstalled WSL Ubuntu? Or should I clean something else before installing WSL Ubuntu with lxrun?

TotomInc avatar Jun 24 '18 15:06 TotomInc

@TotomInc OK, let me elaborate the problem. The error 0x80070003 may mean that the path where you've installed Ubuntu is not present/deleted/removed. There is a second answer in that SO question, written by me.

LxRun.exe /uninstall may only work with legacy installation i.e. LxRun.exe /install. So DON'T use it. Instead use the following procedure. Restart the LxssManager service if you want.

Download the Appx/ZIP file as you did it before. Delete the registry path (as I said before) IF AND ONLY IF there is no other distro installed. Extract Ubuntu.exe and install.tar.gz in a folder path, for example, C:\MyFiles\Ubuntu. Run this command as administrator:

icacls "C:\MyFiles\Ubuntu" /grant Everyone:(OI)(CI)(F)

Now run ubuntu.exe as administrator and it will be installed. And use wslconfig.exe /u Ubuntu to uninstall it.

Biswa96 avatar Jun 24 '18 16:06 Biswa96

Thanks @Biswa96 it works well.

TotomInc avatar Jun 24 '18 19:06 TotomInc

Hello

PS C:\Users\shahj\Downloads\Ubuntu-16.04> wslconfig.exe
Performs administrative operations on Windows Subsystem for Linux

Usage:
    /l, /list [/all] - Lists registered distributions.
        /all - Optionally list all distributions, including distributions that
               are currently being installed or uninstalled.
    /s, /setdefault <DistributionName> - Sets the specified distribution as the default.
    /u, /unregister <DistributionName> - Unregisters a distribution.

I first got a list of all the Windows Subsystems for Linux currently installed on the machine:

PS C:\Users\batman\Downloads\Ubuntu-16.04> wslconfig.exe /l
Windows Subsystem for Linux Distributions:
Ubuntu-18.04 (Default)
Ubuntu

I then deleted them both:

PS C:\Users\batman\Downloads\Ubuntu-16.04> wslconfig.exe /u Ubuntu
Unregistering...
PS C:\Users\batman\Downloads\Ubuntu-16.04> wslconfig.exe /l
Windows Subsystem for Linux Distributions:
Ubuntu-18.04 (Default)
PS C:\Users\batman\Downloads\Ubuntu-16.04> wslconfig.exe /u Ubuntu-18.04
Unregistering...

Ensured there were no existing subsystems:

PS C:\Users\batman\Downloads\Ubuntu-16.04> wslconfig.exe /l
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Windows Store:
https://aka.ms/wslstore
PS C:\Users\batman\Downloads\Ubuntu-16.04>

And I was up and running again!

Just re-installed the Windows Subsystem for Linux again.

jinalshah avatar Feb 13 '19 21:02 jinalshah

Note: You may also get Error 0x80070003 if your domain has configured McAfee to block loading of WSL. (You'd think there would be a nice, clear message, but you just get Error 0x80070003 and you have go dig through the event log to discover the policy.)

This is not a bug in WSL -- but it is a common explanation for Error 0x80070003 in the corporate environment.

kleinfelter avatar Aug 09 '19 23:08 kleinfelter

Note: You may also get Error 0x80070003 if your domain has configured McAfee to block loading of WSL. (You'd think there would be a nice, clear message, but you just get Error 0x80070003 and you have go dig through the event log to discover the policy.)

This is not a bug in WSL -- but it is a common explanation for Error 0x80070003 in the corporate environment.

No, No McAfee only windows solution

benyaminl avatar Feb 03 '21 09:02 benyaminl