Restarting the Windows Subsystem for Linux (WSL) is often needed when a Linux process hangs, the network stack inside WSL stops responding, or a configuration change in .wslconfig isn’t taking effect. Instead of rebooting the entire Windows machine, you can completely shut down and restart the WSL environment in under a minute using PowerShell or Task Manager. This guide covers both methods, plus what to do if the usual commands don’t work.
What You’ll Need
- Windows 10 version 2004 or later, or Windows 11 (WSL 2 is standard on these versions).
- Administrator access to Windows (not strictly required for basic restart, but needed if you’re troubleshooting a stuck WSL service).
- Your WSL distributions installed and configured (any distro works).
Step-by-Step
Method 1: Using PowerShell (Recommended)
- Open PowerShell as Administrator: right-click the Start button and select “Windows PowerShell (Admin)” or “Terminal (Admin)”.
- To see which distributions are currently running, type
wsl -l --runningand press Enter. Note the names of any distros listed. - To shut down the entire WSL subsystem, type
wsl --shutdownand press Enter. This stops all running distributions and the lightweight VM that hosts them. - Wait about 2–3 seconds. Then start your distribution again by typing
wsl(opens default distro) orwsl -d Ubuntu(replace with your distro name). - Verify the restart worked by running
wsl -l --runningagain. Your distro should now appear as “Running”.
Method 2: Using Task Manager
- Press
Ctrl + Shift + Escto open Task Manager. - Go to the “Processes” tab (or “Details” tab if you prefer a more granular view).
- Look for “Windows Subsystem for Linux” or “Vmmem” (the process that uses memory for WSL 2). Right-click it and select “End Task”. Note: This only kills the VM process; it doesn’t cleanly shut down the distro.
- After ending the task, WSL will automatically restart the next time you run a
wslcommand. To force a clean restart, open PowerShell and runwsl --shutdownanyway (this ensures the WSL service is reset). - Start your distro again with
wslorwsl -d <distro>.
Common Mistakes
- Forgetting to close the WSL terminal window: If you have a terminal open that’s inside WSL, the shutdown command may not fully stop the distro because the session is still active. Close all WSL terminal windows before running
wsl --shutdown. - Using
wsl --terminateinstead ofwsl --shutdown:wsl --terminate <distro>only stops a single distribution. If you need to reset the entire WSL network stack or fix a global issue, usewsl --shutdown. - Running PowerShell as a standard user: Some WSL commands, especially those that modify the VM, may require admin rights. If you get an access denied error, close and reopen PowerShell as administrator.
- Killing Vmmem in Task Manager and expecting a clean restart: Ending the Vmmem process is a forced kill; it doesn’t run the graceful shutdown sequence. Always follow up with
wsl --shutdownto avoid file system corruption.
Tips
- Set a default distro before restarting: run
wsl --set-default Ubuntu(replace with your distro) so that the plainwslcommand opens the one you use most. - If you’re editing
.wslconfig(e.g., to change memory limits), you must runwsl --shutdownfor changes to take effect — simply closing the terminal isn’t enough. - Create a desktop shortcut that runs
wsl --shutdownin PowerShell to make restarting a one-click action. - If you use Docker Desktop with WSL 2 backend, restarting WSL will also stop Docker containers. Plan accordingly.
- Check WSL status with
wsl --statusto see the default version and kernel info before troubleshooting.
Troubleshooting
If the restart doesn’t go as planned, try these steps in order:
- Check if WSL is still running: Run
wsl -l --running. If it still shows your distro, close all terminals and runwsl --shutdownagain. - Restart the WSL service: Open PowerShell as admin and run
Get-Service LxssManager | Restart-Service. This restarts the Windows service that manages WSL. - Check for orphaned processes: In Task Manager, look for any processes named
wslhost.exeorvmmemWSL. End them, then runwsl --shutdown. - If WSL fails to start after restart: Run
wsl --updateto update the WSL kernel, then try again. - Check the Windows Event Log: Open Event Viewer, go to Windows Logs > System, and look for errors from “LxssManager” or “WSL”. This can reveal the underlying cause.
- As a last resort: Unregister and re-register the distro (this deletes all data inside it — back up first). Run
wsl --unregister Ubuntuthen reinstall from the Microsoft Store.
Frequently Asked Questions
Does restarting WSL delete my files?
No. wsl --shutdown only stops the VM; it doesn’t remove any files or configurations. Your Linux file system remains intact.
What’s the difference between wsl --shutdown and closing the terminal window?
Closing the terminal window just ends your session; the WSL VM may keep running in the background. wsl --shutdown stops the entire VM, which is necessary to reset network or memory issues.
Can I restart WSL without admin rights?
Yes, wsl --shutdown generally works as a standard user. However, some related service restarts require admin privileges.
Why is my WSL still slow after restart?
A restart fixes temporary issues, but if performance is consistently poor, check your .wslconfig memory and CPU settings, and ensure you’re on the latest WSL version.
Will restarting WSL affect my running Docker containers?
Yes, if Docker Desktop uses the WSL 2 backend, all containers will stop when WSL shuts down. Restart them after WSL is back up.
Do I need to restart WSL after changing .wslconfig?
Yes, changes to .wslconfig only apply after a full wsl --shutdown and restart.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Fix Apps Not Downloading From Play Store
- Secure a Samsung Galaxy After a Zero-Day Disclosure
- What to Check Before Installing Linux Alongside Windows
- Fix OEM Activation Error 0xc004c060 in Windows 10
- Why Does My App Run One Query for the List and One per Item?
- Fix Google Chrome Has Stopped Working