10

I got the windows anniversary update and tried to install Bash. I ran bash from the command prompt (non-admin mode) and it got stuck while trying to extract the files. I closed the window and tried to do the same with elevated privileges (command prompt run as admin).

But now when I enter bash, it is stuck there and doesn't launch or ask me to install bash. I could see bash process consuming 25% of CPU in the background.

When I try to uninstall bash running lxrun /uninstall /full, it fails to uninstall:

C:\WINDOWS\system32>lxrun /uninstall /full
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: 0x80080005

How could I reset the Linux subsystem for windows 10?

EDIT: Also tried options mentioned here by Microsoft.

Also, check out this issue. Bash does nothing for a while then exits

  • How long did you actually wait for it to (un)install? – gronostaj Aug 4 '16 at 10:56
  • I waited for about 30 mins. – Vivek Vijayan Aug 4 '16 at 10:57
  • Alternatively you could go to Enable or disable Windows features and uncheck Windows subsystem for Linux (Beta) and then restart. After that, reenable the same checkbox and restart again. On my machine, I could not run lxrun. – kleinfreund Aug 4 '16 at 12:39
  • I tried all that! I think this is a widely reported issue – Vivek Vijayan Aug 4 '16 at 13:26
  • @VivekVijayan - Take ownership of %localappdata%\lxss then delete it. You can then use lxrun /install to install Ubuntu on Windows again. This assumes you have developer mode enabled and have already added the (Windows Linux Subsystem) Windows Feature. – Ramhound Aug 4 '16 at 18:03
5

I initially had problems uninstalling a failed install and removing the lxss folder. After I successfully cleaned up the installation, I began my trials to reinstall, but the earlier problem with installing popped up. The process gets stuck Extracting Filesystem... as reported here.

After days of trial and error, I seem to have found the reason for this agony. In my case (and as reported by many others here) it is the antivirus being the spoilsport. Disabling antivirus and restarting seem to do it for me. As silly as it sounds, Antivirus was the main cause for the pain and Error: 0x80080005

Now for those who still have this error, this is should help if you try doing the following things in order:

  1. Disable Antivirus permanently & Restart (You can enable it after the installation is complete)
  2. Open Command Prompt or Windows PowerShell as admin
  3. Uninstall WSL by running the following command lxrun /uninstall /full
  4. Now stop WSL service - sc stop lxssmanager
  5. Remove App data folders - rmdir /S %LOCALAPPDATA%\lxss. Confirm the folders have been deleted. You might need to change the ownership to delete the folder if you get any access-denied errors.
  6. Once the folders are deleted, try installing WSL again by running lxrun /install /y
  7. Wait until it downloads from the Windows Store and Extracts the files. (You can check %LOCALAPPDATA%\lxss\rootfs to see if the files have been extracted).
  8. Hopefully you shouldn't get a Error: 0x80080005 this time.
  9. Enjoy Bash on Windows!

EDIT : Another reason for the error is identified as a bug when you have multiple swap files. This will be fixed in the future, but for now, remove other swap files and keep only one swapfile. This should fix it.

More details for those interested:

"Because of your trace file I have identified a bug in the installation code that is calculating the swap file size. This function is used by both the sysinfo system call and generating the contents of /proc/meminfo. This problem will happen when you have multiple pagefiles on your machine. There are three different outcomes that can happen as a result of this bug: The swapfile size will be reported incorrectly Our driver will dereference an invalid memory address and cause a bluescreen The machine will enter an infinite loop when calculating the swap file size (this is the one you are seeing) As a temporary workaround if you remove all but one of your pagefiles you should be able to use WSL. I am coding up a fix for this right now."

Reference: Bash on Ubuntu on Windows

  • Thanks, this helped me. I had Windows Defender running and I only had to do 1-3 and 6-9, i.e. I didn't have to stop the service or delete anything. – Tom Ellis Apr 3 '17 at 14:25
  • Happy to help. In some cases, WSL service hinders the clean removal of installation files. Glad you didn't have to go through all that. – Vivek Vijayan Apr 3 '17 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.