How to Terminate Running 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.

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.

--terminate or --t has been added to wsl.exe that will immediately terminate a running installed or imported WSL distro.

See also: What’s new for WSL in Windows 10 version 1903?

This tutorial will show you how to terminate a running Windows Subsystem for Linux (WSL) distro for your account in Windows 10.


 CONTENTS:

  • Option One: See List of All Running Windows Subsystem for Linux (WSL) Distros
  • Option Two: Terminate Running Windows Subsystem for Linux (WSL) Distro in Settings
  • Option Three: Terminate Running Windows Subsystem for Linux (WSL) Distro in Command Prompt
  • Option Four: Terminate Running Windows Subsystem for Linux (WSL) Distro in PowerShell





OPTION ONE

See List of All Running Windows Subsystem for Linux (WSL) Distros


1. For how, see: How to List All Running Windows Subsystem for Linux (WSL) Distros in Windows 10

This will show you the names of all currently running WSL distros for your account.

Terminate Running Windows Subsystem for Linux Distro in Windows 10-list_all_running_wsl_distros_command.png Terminate Running Windows Subsystem for Linux Distro in Windows 10-list_all_running_wsl_distros_powershell.png
Terminate Running Windows Subsystem for Linux Distro in Windows 10-linux_navigation_pane-1.jpg Terminate Running Windows Subsystem for Linux Distro in Windows 10-linux_navigation_pane-2.jpg






OPTION TWO

Terminate Running Windows Subsystem for Linux (WSL) Distro in Settings



This option will only work for a running app of an installed WSL distro, and not for an imported WSL distro.

1. Open Settings, and click/tap on the Apps icon.

2. Click/tap on a running WSL distro app (ex: "Debian") from Option One on the right side you want to terminate, and click/tap on the Advanced options link. (see screenshot below)

Terminate Running Windows Subsystem for Linux Distro in Windows 10-terminate_wsl_distros_in_settings-1.jpg

3. Scroll down and click/tap on the Terminate button to force close the WSL distro app (ex: "Debian"). (see screenshot below)

Terminate Running Windows Subsystem for Linux Distro in Windows 10-terminate_wsl_distros_in_settings-2.jpg






OPTION THREE

Terminate Running Windows Subsystem for Linux (WSL) Distro in Command Prompt


1. Open a command prompt.

2. 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 -t <DistributionName> OR wsl --terminate <DistributionName>

OR

(For versions earlier than Windows 10 version 1903)
wslconfig /t <DistributionName> OR wslconfig /terminate <DistributionName>

Substitute <DistributionName> in the command above with the actual WSL distro name (ex: "Debian") from Option One you want to terminate.

For example: wsl --terminate Debian


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

Terminate Running Windows Subsystem for Linux Distro in Windows 10-terminate_wsl_distros_command_prompt.png






OPTION FOUR

Terminate Running Windows Subsystem for Linux (WSL) Distro in PowerShell


1. Open a PowerShell.

2. 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 -t <DistributionName> OR wsl --terminate <DistributionName>

OR

(For versions earlier than Windows 10 version 1903)
wslconfig /t <DistributionName> OR wslconfig /terminate <DistributionName>

Substitute <DistributionName> in the command above with the actual WSL distro name (ex: "Debian") from Option One you want to terminate.

For example: wsl --terminate Debian


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

Terminate Running Windows Subsystem for Linux Distro in Windows 10-terminate_wsl_distros_powershell.png


That's it,
Shawn