How to remove/reset Windows Subsystem for Linux on Windows Insider Build 14316

116

41

I installed the Windows Subsystem for Linux on Windows 10 Insider Preview build 14316. Now I would like to remove it or, better, revert to its factory defaults i.e. as it was when just installed.

I tried, to remove it from the "Turn Windows features on or off" windows, with no luck. I tried, to mark it as "off" in the above windows and delete its files manually located in %USERPROFILE%/AppData/Local/lxss, with no luck.

Has anyone succeeded in removing/resetting the Ubuntu user-mode environment?

shub

Posted 2016-04-14T20:35:33.653

Reputation: 1 362

Answers

155

The following answer only applies to WSL on Windows 10 1703 and 1607. WSL on Windows 10 1709+ can be installed from within the Windows Store UWP application.

If you want to remove and reset the Linux subsystem, open a command line prompt with elevated permissions and enter the following commands:

lxrun /uninstall /full 

lxrun /install

Sources:

  1. https://www.slightfuture.com/technote/lxss-lxrun

  2. Installing Fish Shell on Ubuntu on Windows 10

  3. HOWTO: Ubuntu on Windows | Ubuntu Insights

Ramhound

Posted 2016-04-14T20:35:33.653

Reputation: 28 517

2Godsend, broke it just after installing. – wieczorek1990 – 2016-04-20T18:30:57.917

Yea, broke mine almost immediately trying to install a jdk – James Adam – 2016-08-03T00:36:36.057

14If you get an error code 0x80070091 after trying to install again, go to %localappdata%\lxss and remove all files/folders manually. It should work afterwards. – SeinopSys – 2016-08-03T02:34:02.003

1Use /y option to skip asking prompts. – Biswapriyo – 2017-10-20T13:51:25.447

1anyone know how to do this now that lxrun has been removed? – Matthew Whited – 2018-12-30T17:57:12.690

@MatthewWhited - How can the bash shell on Window be completely reset?. Questions submitted as a comment are subject to be removed as being no longer required. In the future you are better off just submitting a question, it being closed as a duplicate, then submitting a comment like that.

– Ramhound – 2018-12-30T17:58:42.723

1

I was having problems with installing BASH, it would always hang at "Expanding Filesystem...". When I ran

lxrun /uninstall /full

it would error out.

To fix this, I did a reboot. Ran this again as soon as the computer came back up. This worked. Then I found there is an issue related to installing the BASH prompt.

And someone brought up about pagefiles. I have four drives and three of them had pagefiles. I set the pagefile to one drive and set it to be automatically managed. Rebooted the computer. Then I was able to install the BASH prompt for Windows, but instead of using lxrun /install I used

bash.exe -c "ps auxf"

SPLUS1

Posted 2016-04-14T20:35:33.653

Reputation: 11