How to unregister WSL2 Linux distro on Windows 10

Do you need to unregister a Linux distro to reset it to its default settings? Here's how with the WSL command-line tool on Windows 10.

WSL2 unregister Linux distro
WSL2 unregister Linux distro

On Windows Subsystem for Linux 2 (WSL2), it is possible to unregister a Linux distro (such as Ubuntu or Kali Linux) to reset it and start fresh with the distribution without re-downloading the container from the Microsoft Store.

When you unregister a distro on Windows 10, it will no longer be available in the WSL environment, and all the changes made will be discarded. The next time you launch the distro from the Start menu or Microsoft Store, it will start as if it was the first time, and you will need to go through the process to set it up again.

Microsoft defines the unregistering process as a way to uninstall the WSL2 distro, but without deleting the virtual machine from the device like the rest feature available in the Settings app.

In this guide, you will learn the steps to unregister and reinstall a distribution of Linux on the Windows Subsystem for Linux 2 platform.

Unregister Linux distro on WSL2

To unregister a Linux distribution on WLS2, use these steps:

  1. Open Start on Windows 10.

  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.

  3. Type the following command to view a list of all available distros and press Enter:

    wsl --list
    Quick tip: You can also write the command like this: wsl -l.
  4. Type the following command to set a distro as the new default and press Enter:

    wsl --unregister DISTRO-NAME

    In the command, replace DISTRO-NAME for the name of the distro you want to set as default (see step No. 3).

    For example, this command unregisters Kali Linux:

    wsl --unregister Kali-linux

    WSL2 unregister command
    WSL2 unregister command
  5. Type the following command to confirm distros and press Enter:

    wsl --list

Once you complete the steps, the distro will reset and no longer be available in WSL, but it won’t be uninstalled from the computer. If you want to reinstall the distro, click the Launch button from the Microsoft Store or select it from the Start menu to start over with the setup.

About the author

Mauro Huculak is a Windows How-To Expert and founder of (est. 2010). With over 21 years as a technology writer and IT Specialist, Mauro specializes in Windows, software, and cross-platform systems such as Linux, Android, and macOS.

Certifications: Microsoft Certified Solutions Associate (MCSA), Cisco Certified Network Professional (CCNP), VMware Certified Professional (VCP), and CompTIA A+ and Network+.

Mauro is a recognized Microsoft MVP and has also been a long-time contributor to Windows Central.

You can follow him on YouTube, Threads, BlueSky, X (Twitter), LinkedIn and About.me. Email him at [email protected].