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.
- 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
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.
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)
3. Scroll down and click/tap on the Terminate button to force close the WSL distro app (ex: "Debian"). (see screenshot below)
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>
ORwsl --terminate <DistributionName>
OR
(For versions earlier than Windows 10 version 1903)
wslconfig /t <DistributionName>
ORwslconfig /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.
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>
ORwsl --terminate <DistributionName>
OR
(For versions earlier than Windows 10 version 1903)
wslconfig /t <DistributionName>
ORwslconfig /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.
That's it,
Shawn
Related Tutorials
- How to Terminate Store Apps in Windows 10
- How to Enable or Disable Windows Subsystem for Linux (Bash on Ubuntu) in Windows 10
- How to Install Windows Subsystem for Linux (WSL) Distros in Windows 10
- How to Update and Upgrade Windows Subsystem for Linux (WSL) Distro Packages in Windows 10
- How to Unregister and Reset Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Add User to Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Add, Remove, and List Sudo Users in Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to List Users in Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Change User Password in Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Reset User Password in Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Export and Import Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Add or Remove Linux in Navigation Pane of File Explorer in Windows 10
- How to List All Available Windows Subsystem for Linux (WSL) Distros in Windows 10
- How to List All Running Windows Subsystem for Linux (WSL) Distros in Windows 10
- How to Set Default Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Run a Windows Subsystem for Linux (WSL) Distro in Windows 10
- How to Access Linux Files in a Windows Subsystem for Linux (WSL) Distro from Windows 10