Wednesday, January 1, 2025

Creating liberating content

Fedora-Based Nobara 41 Gaming...

Nobara 41 gaming distribution is now available for download based on Fedora Linux...

PeaZip 10.2 Open-Source Archive...

PeaZip 10.2 open-source archive manager is now available for download with GUI support...

KDE Plasma 6.2.5 Released...

KDE Plasma 6.2.5 is now available as the fifth and last update to...

Debian 13 “Trixie” Installer...

Debian GNU/Linux 13 “Trixie” installer is now ready for public testing with support...

Shut Down WSL Running Linux Distributions

Shut Down WSL Running Linux Distributions

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 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.

Shut Down WSL Running Linux Distributions
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
Shut Down WSL Running Linux Distributions
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
Shut Down WSL Running Linux Distributions
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 Linus 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.

Shut Down WSL Running Linux Distributions
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>
Shut Down WSL Running Linux Distributions
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.

from It’s FOSS https://ift.tt/1QUJVtY

Get notified whenever we post something new!

spot_img

Create a website from scratch

Just drag and drop elements in a page to get started with Newspaper Theme.

Continue reading

Fedora-Based Nobara 41 Gaming Distro Switches to Open-Source NVIDIA Driver

Nobara 41 gaming distribution is now available for download based on Fedora Linux 41 and featuring the KDE Plasma 6.2 desktop environment. Here's what's new! The post Fedora-Based Nobara 41 Gaming Distro Switches to Open-Source NVIDIA Driver appeared first on...

PeaZip 10.2 Open-Source Archive Manager Released with Qt 6 Package for Linux

PeaZip 10.2 open-source archive manager is now available for download with GUI support for Brotli and Zstandard maximum compression settings and other changes. Here's what's new! The post PeaZip 10.2 Open-Source Archive Manager Released with Qt 6 Package for Linux...

KDE Plasma 6.2.5 Released as the Last Update in the Series with More Bug Fixes

KDE Plasma 6.2.5 is now available as the fifth and last update to the KDE Plasma 6.2 desktop environment series with more bug fixes and other changes. The post KDE Plasma 6.2.5 Released as the Last Update in the Series...

Enjoy exclusive access to all of our content

Get an online subscription and you can unlock any article you come across.