Microsoft’s Windows Subsystem for Linux version 2, or WSL2, is a cool tool that lets developers run a Linux environment right on Windows, no need to mess with dual-boot setups or virtual machines. It means you can play around with Linux command-line stuff while chilling in your Windows 11 space. In this guide, we’ll walk you through how to get WSL2 started, restart it, or shut it down on your Windows 11 system.
Also see: How to Run CMD or PowerShell as SYSTEM in Windows 11
Page Contents
Starting WSL2
Before getting into WSL2, make sure it’s all set up and ready on your Windows 11. Haven’t done it yet? Check out the official Microsoft guide for setting up WSL2.
Got WSL2 installed? Great! Starting it is easy. Just pop open the Command Prompt
or PowerShell
with admin rights. To do so, right-click the Start button and pick either “Command Prompt (Admin)” or “PowerShell (Admin)”.
With your Command Prompt or PowerShell open, type in this command to get WSL2 started:
wsl
This opens up the default Linux distribution you’ve got installed. If you’ve got more than one and want to open a specific one, use the -d
flag and the name of the distribution. For Ubuntu, it looks like this:
wsl -d Ubuntu
Restarting WSL2
Want to give WSL2 a quick restart? Here are some ways to restart it on Windows 11:
- First, shut down WSL2 (we’ll talk about that later) and then fire it up as you did before.
- Give the LxssManager service a quick reset. Hit
Win + R
, typeservices.msc
, and press Enter.Find theLxssManager
service, right-click it, and hitRestart
. - Or, use PowerShell to restart the LxssManager service. Open PowerShell as an admin and run:
Get-Service LxssManager | Restart-Service
Shutting down WSL2
Done with Linux for now? Shutting down WSL2 is a good idea to free up some resources. Just open Command Prompt
or PowerShell
like you did before and run:
wsl --shutdown
Shutting down WSL2 completely turns off the Linux part of your system. It’s a smart move to shut it down when you’re not using it to help your computer run smoother.
Linked issue: This App is Preventing Shutdown or Restart
Precautions before shutting down
Please know that shutting down WSL2 is like turning off a real computer. Anything you haven’t saved in Linux will be lost. So, make sure you’ve saved all your work and closed any programs you don’t want to stop suddenly.
Ending notes
Using WSL2 on your Windows 11 system is like having the best of both worlds. You can switch between Windows and Linux without any hassle. Knowing how to start, pause, or shut down WSL2 gives you the flexibility to jump into Linux whenever you need it, without eating up your system’s resources when you don’t.
Getting the hang of these methods is a small but important part of using your Windows and Linux setup more efficiently. Just make sure to save your work before shutting down, just like you would with any computer. And if you need more help or the latest updates, always check the official Microsoft documentation.