Completely reinstall WSL

I installed WSL 1, enjoyed having Linux on my PC, then discovered the limitations of the scarce interoperability over files between the two operating systems.

So I installed WSL 2 following the specs (enabled virtualization in BIOS settings and all the stuff) but the installation is not completely working, I cannot set it as default and not all the shell commands respond as expected.
I googled and somebody had similar issues, but not so many straightforward solutions are proposed (I guess it is still a relatively new case).

So I want remove WSL as deeply as possible and reinstall WSL 2 from scratch.

  • What is the most secure and advisable process to remove WSL completely?
  • Can WSL 2 be installed from scratch without installing WSL 1 before?

1 Answer

Can WSL 2 be installed from scratch without installing WSL 1 before?

No. The base WSL support is required for WSL2.

What is the most secure and advisable process to remove WSL completely?

Here's the best info I have on removing everything related to WSL.

It sounds like you consider the existing instance a lost cause, but if you'd like to back it up for posterity, you can start with:

  • wsl --export <distroname> archivename.tar

Then remove the existing distro installation(s):

  • Any distro you installed from the Store, you should first remove through "Apps & Features" (a.k.a. "Add or remove programs") in Windows. This also goes for distributions installed manually via downloaded Appx package.

Then check to make sure nothing is left. From PowerShell or CMD:

  • wsl -l
  • wsl --unregister <distroname>

You may want to just install a new distro at that point from the Store. It's unlikely that any additional reinstallation of the other components is going to make a difference. But if you do want to remove them:

  • From "Apps & Features" (a.k.a. "Add or remove programs") in Windows, remove the "Windows Subsystem for Linux Update". I'm fairly certain this is the Linux kernel update. Probably reboot if you want to be sure it's fully gone before the next step.
  • From "Turn Windows Features on or off" in Windows, disable the "Virtual Machine Platform". This is the WSL2 Hyper-V support. Probably reboot if you want to be sure it's fully gone before the next step.
  • From "Turn Windows Features on or off", disable "Windows Subsystem for Linux.
  • Reboot.

When you are reinstalling from there, I'd appreciate it if you could confirm that "Windows Subsystem for Linux Update" returns to Apps & Features after installing the kernel update package (Step 4 in the Install doc). I will update this answer based on that info.

7

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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

You Might Also Like