> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Shut Down WSL Running Linux Distributions
- URL: https://itsfoss.com/shut-down-wsl-distros/
- Published: 2024-06-06T10:17:00.000Z
- Updated: 2025-02-05T10:58:41.000Z
- Description: Here are different ways to shut down Linux systems running inside Windows with WSL.
- Author: Sreenath
- Tags: Using WSL

So you are running Linux inside Windows using WSL. And you are wondering how you can shut down the Linux distribution running in WSL. 

You can surely [try the shutdown command](https://linuxhandbook.com/linux-shutdown-command/?ref=itsfoss.com) from within the Linux system running in WSL:

```
sudo shutdown now
```

You can also shut down Linux systems using WSL commands. It's an excellent method if you have more than one distro running is WSL.

## Shutdown Linux in WSL using Windows Terminal

In this method, I assume that the usual `shutdown` command doesn't work in WSL Linux Systems. 

First, open a terminal in windows. Here, I am using Windows 11 with an Ubuntu setup under WSL 2.

![Open a terminal by searching for it on the Windows 11 Start menu](https://itsfoss.com/content/images/2024/01/open-a-terminal-from-start-menu.png)

Open a Windows Terminal

💡

You can use the `wsl` command on a standard Windows terminal. The command is also accessible inside a running Linux distribution. Here, the name of the command is `wsl.exe`.

Now, you need to list what distros are installed and what are their status. To do this, enter:

```
wsl --list --verbose

OR

wsl -l -v
```

![List all the installed WSL Linux Distribution and their current status.](https://itsfoss.com/content/images/2024/01/list-installed-distributions-and-their-status.png)

List Installed Distributions

Here, you can see that, I have one installed WSL Ubuntu, which is currently running.

### Shutdown all running Linux distributions

There may be times, when you want to stop app the running WSL instances in one go. 

In Powershell or Windows Terminal, use this command:

```
wsl --shutdown

```

This will shut down all sessions. 

Also, you can **perform the same function inside any running WSL Linux Distribution terminal**. You just need to use `wsl.exe` instead of `wsl`, while working inside a distribution.

```
wsl.exe --shutdown

```

![Shutting down all running WSL distributions from within another WSL Linux distribution](https://itsfoss.com/content/images/2024/01/shutdown-all-wsl-distros-within-another-distro.gif)

Shut Down All Running WSL Distributions

Once you run this command, all the running WSL distributions will be terminated. The WSL 2 lightweight utility virtual machine is also terminated. **So it will be useful, if you want to restart the WSL 2 virtual machine environment.**

### Terminate a particular Linux distribution

To terminate a particular running WSL distribution, open a separate Windows terminal and run:

```
wsl --terminate <Distribution Name>

```

Here, the distribution name is the one you get, when you list all the installed WSL distributions using the `wsl -l -v` ⁣ command. 

![List the WSL distributions](https://itsfoss.com/content/images/2024/01/list-the-distro-to-terminate-only-that-one.png)

List WSL Distributions

```
wsl --terminate Ubuntu
```

Once executed, the specified Linux distribution will be terminated.

If you are inside another distribution, list all the WSL distros installed on your system using:

```
wsl.exe -l -v
```

Now, terminate the required distro using:

```
wsl.exe --terminate <Distribution name>
```

![Shutting Down another WSL Distribution from a running WSL distribution](https://itsfoss.com/content/images/2024/01/shutdown-successfully-completed.png)

Shutting down a WSL Distribution from inside another

## Conclusion

Some people just close the running Linux application but I don't think that's very graceful.

Also, like a Linux terminal, you can either use:

- The `logout` command, to close that distro.
- The `exit` command to quit that terminal running the Linux distro.
- Or, press CTRL+D to do the same as exit command.

But the WSL way of shutting down Linux system has the added advantage of doing it for multiple Linux systems.

I hope it helps you.