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





Terminate Running Windows Subsystem for Linux Distro in Windows 10 OPTION ONE Terminate Running Windows Subsystem for Linux Distro in Windows 10
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.

Name:  List_all_running_WSL_distros_command.png
Views: 80
Size:  7.2 KB Name:  List_all_running_WSL_distros_PowerShell.png
Views: 78
Size:  5.5 KB
Name:  Linux_navigation_pane-1.jpg
Views: 85
Size:  36.4 KB Name:  Linux_navigation_pane-2.jpg
Views: 80
Size:  38.7 KB






Terminate Running Windows Subsystem for Linux Distro in Windows 10 OPTION TWO Terminate Running Windows Subsystem for Linux Distro in Windows 10
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)

Name:  Terminate_WSL_distros_in_Settings-1.jpg
Views: 79
Size:  51.1 KB

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

Name:  Terminate_WSL_distros_in_Settings-2.jpg
Views: 79
Size:  39.2 KB






Terminate Running Windows Subsystem for Linux Distro in Windows 10 OPTION THREE Terminate Running Windows Subsystem for Linux Distro in Windows 10
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.

Name:  Terminate_WSL_distros_command_prompt.png
Views: 79
Size:  6.6 KB






Terminate Running Windows Subsystem for Linux Distro in Windows 10 OPTION FOUR Terminate Running Windows Subsystem for Linux Distro in Windows 10
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.

Name:  Terminate_WSL_distros_PowerShell.png
Views: 74
Size:  4.8 KB


That's it,
Shawn


Related Tutorials