How to Unregister and Reset Windows Subsystem for Linux (WSL) Distro in Windows 10


The Windows Subsystem for Linux (WSL) is a new Windows 10 feature that enables you to run native Linux command-line tools directly on Windows, alongside your traditional Windows desktop and modern store apps.

When you have Windows Subsystem for Linux (WSL) enabled, you can install WSL distro apps from the Microsoft Store.

The first time a newly installed WSL distro runs, a Console window will open, and you'll be asked to wait for a minute or two for the installation to complete.

Once installation is complete, you will be prompted to create a new user account (and its password).

Creating your Linux user is the first step in setting up a new Linux distribution on WSL. The first user account you create is automatically configured with a few special attributes:
  1. It is your default user -- it signs-in automatically on launch.
  2. It is Linux administrator (a member of the sudo group) by default.

Each Linux distribution running on the Windows Subsystem for Linux has its own Linux user accounts and passwords. You will have to configure a Linux user account any time you add a distribution, reinstall, or reset. Linux user accounts are not only independent per distribution, they are also independent from your Windows 10 user account.

If needed, you can unregister a WSL distro to reset it back to default for your account. Once unregistered, all users, data, settings, and software associated with that distribution will be permanently lost. The unregistered WSL distro will be removed from the available WSL distros list.

When you run the unregisted WSL distro app next, a clean copy of the distro will be installed allowing you to also setup the distro with a new UNIX username and password.

Starting with Windows 10 build 18342 (19H1) and Windows 10 build 18836 (20H1), Microsoft added some new commands that will give you more functionality when using wsl.exe. The commands that existed inside of wslconfig.exe have been added to wsl.exe to allow you to configure your distros more easily.

See also:

This tutorial will show you how to unregister and reset a Windows Subsystem for Linux (WSL) distro to default settings for your account in Windows 10.

If you unregister an imported WSL distro, it will be completely removed/uninstalled.


 CONTENTS:

  • Option One: Unregister and Reset a Windows Subsystem for Linux (WSL) Distro in Settings
  • Option Two: Unregister and Reset a Windows Subsystem for Linux (WSL) Distro in Command Prompt
  • Option Three: Unregister and Reset a Windows Subsystem for Linux (WSL) Distro in PowerShell





Unregister Windows Subsystem for Linux (WSL) Distro in Windows 10 OPTION ONE Unregister Windows Subsystem for Linux (WSL) Distro in Windows 10
Unregister and Reset a Windows Subsystem for Linux (WSL) Distro in Settings

1. For how to reset a WSL distro app in Settings, see: How to Reset an App in Windows 10

Name:  Reset_and_unregister_WSL_distro_Settings.png
Views: 99
Size:  14.4 KB

2. You can now run this WSL distro app to reinstall and setup the distro with a new UNIX username and password. (see screenshot below)

Name:  WSL_distro_setup.jpg
Views: 90
Size:  26.8 KB






Unregister Windows Subsystem for Linux (WSL) Distro in Windows 10 OPTION TWO Unregister Windows Subsystem for Linux (WSL) Distro in Windows 10
Unregister and Reset a Windows Subsystem for Linux (WSL) Distro in Command Prompt

1. Open a command prompt.

2. Copy and paste the command below for your version of Windows 10 into the command prompt, and press Enter. Make note of the name of the available WSL distro you want to unregister. (see screenshot below)

(For Windows 10 version 1903 and later)
wsl --list --all or wsl -l --all

OR

(For versions earlier than Windows 10 version 1903)
wslconfig /list /all or wslconfig /l /all

Name:  List_all_WSL_distros.png
Views: 98
Size:  7.8 KB

3. Enter the command below for your version of Windows 10 into the command prompt, and press Enter. (see screenshot below)

(For Windows 10 version 1903 and later)
wsl --unregister <DistributionName>

OR

(For versions earlier than Windows 10 version 1903)
wslconfig /unregister <DistributionName>

Substitute <DistributionName> in the command above with the actual WSL distro name (ex: "Ubuntu") from step 2 you want to unregister.

For example: wsl --unregister Ubuntu


Name:  Unregister_WSL_distro_command_prompt.png
Views: 97
Size:  4.2 KB

4. When finished, you can close the command prompt if you like.

5. You can now run this WSL distro app to reinstall and setup the distro with a new UNIX username and password. (see screenshot below)

Name:  WSL_distro_setup.jpg
Views: 90
Size:  26.8 KB






Unregister Windows Subsystem for Linux (WSL) Distro in Windows 10 OPTION THREE Unregister Windows Subsystem for Linux (WSL) Distro in Windows 10
Unregister and Reset a Windows Subsystem for Linux (WSL) Distro in PowerShell

1. Open PowerShell.

2. Copy and paste the command below for your version of Windows 10 into PowerShell, and press Enter. Make note of the name of the available WSL distro you want to unregister. (see screenshot below)

(For Windows 10 version 1903 and later)
wsl --list --all or wsl -l --all

OR

(For versions earlier than Windows 10 version 1903)
wslconfig /list /all or wslconfig /l /all

Name:  List_all_WSL_Linux_distros_in_PowerShell.png
Views: 99
Size:  5.7 KB

3. Enter the command below for your version of Windows 10 into PowerShell, and press Enter. (see screenshot below)

(For Windows 10 version 1903 and later)
wsl --unregister <DistributionName>

OR

(For versions earlier than Windows 10 version 1903)
wslconfig /unregister <DistributionName>

Substitute <DistributionName> in the command above with the actual WSL distro name (ex: "Ubuntu") from step 2 you want to unregister.

For example: wsl --unregister Ubuntu


Name:  Unregister_WSL_distro_PowerShell.png
Views: 91
Size:  5.0 KB

4. When finished, you can close PowerShell if you like.

5. You can now run this WSL distro app to reinstall and setup the distro with a new UNIX username and password. (see screenshot below)

Name:  WSL_distro_setup.jpg
Views: 90
Size:  26.8 KB


That's it,
Shawn


Related Tutorials