Curious Minds

Clear answers to science and history questions

How to Restart WSL: Step-by-Step Guide

· 5 min read · Science

To restart WSL, open PowerShell or Command Prompt as Administrator and run wsl --shutdown. This stops all running WSL distributions and the lightweight utility VM that hosts them. The next time you open a WSL terminal or run a WSL command, the VM and your default distribution start fresh. This clears stuck processes, resets network and memory state, and applies changes to .wslconfig. No data in your Linux filesystem is lost, but unsaved work in running processes will be terminated.

What You'll Need

  • A Windows 10 (version 2004 or later) or Windows 11 PC with WSL installed.
  • Access to PowerShell or Command Prompt. Administrator rights are recommended for wsl --shutdown and required for some troubleshooting steps.
  • Knowledge of your WSL distribution name (e.g., Ubuntu) if you want to restart a single distribution. Run wsl --list --verbose to see names.
  • Backup of any unsaved work in Linux applications, as restarting terminates running processes.

Step-by-Step

  1. Open PowerShell or Command Prompt as Administrator. Press Win + X and choose “Windows PowerShell (Admin)” or “Terminal (Admin)”. Administrator rights ensure the shutdown command can stop all WSL processes.
  2. List your WSL distributions (optional). Run wsl --list --verbose to see the names and states of your distributions. This helps if you plan to restart a specific one.
  3. Shut down all WSL instances. Run wsl --shutdown. This stops all distributions and the WSL 2 lightweight VM. There is no confirmation prompt; the command returns immediately.
  4. Verify that WSL has stopped. Run wsl --list --running. It should output “There are no running distributions.” If distributions still appear, wait a few seconds and run the command again.
  5. Restart WSL by launching a distribution. Open your Linux distribution from the Start menu, or run wsl in PowerShell. This starts the WSL VM and your default distribution. Alternatively, run wsl -d <DistroName> to start a specific distribution.
  6. Restart a single distribution (optional). If you only want to restart one distribution without stopping others, run wsl --terminate <DistroName>. Then start it again with wsl -d <DistroName>. Note that terminating a distribution does not stop the WSL 2 VM if other distributions are running.
  7. Confirm the restart worked. In your Linux terminal, run ps aux or top to check that only expected processes are running. You can also check the uptime with uptime; it should show a short time since the restart.

Common Mistakes

  • Running wsl --shutdown without saving work. The command forcefully terminates all Linux processes. Save files and close applications first.
  • Confusing wsl --shutdown with wsl --terminate. --shutdown stops the entire WSL subsystem, while --terminate stops only the specified distribution. Using the wrong one may leave other distributions running or stop more than intended.
  • Expecting the command to restart automatically. wsl --shutdown only stops WSL. You must start a distribution again to restart it.
  • Not using an elevated prompt. Without administrator rights, wsl --shutdown may fail silently or return an error. Always open PowerShell as Administrator.
  • Assuming data loss. Restarting WSL does not delete files in your Linux home directory or installed packages. Only unsaved in-memory data is lost.

Tips

  • Create a desktop shortcut or alias for wsl --shutdown to restart quickly.
  • After editing .wslconfig (located at C:\Users\<YourName>\.wslconfig), run wsl --shutdown to apply changes such as memory limits or kernel settings.
  • If WSL seems slow or unresponsive, a restart often resolves temporary issues without rebooting Windows.
  • Use wsl --list --verbose to check the WSL version (1 or 2) of each distribution. Restarting behavior is the same, but WSL 2 uses a VM that is fully stopped by --shutdown.
  • To restart WSL from inside a Linux terminal, you can run wsl.exe --shutdown if the Windows host path is available, but it is usually easier to use a Windows terminal.

Troubleshooting

  • wsl --shutdown returns “The operation could not be started” or similar. Ensure you are running PowerShell as Administrator. If the error persists, restart the LxssManager service: open Services (services.msc), find “LxssManager”, and restart it. Then try wsl --shutdown again.
  • WSL distributions still show as running after shutdown. Wait a few seconds and run wsl --list --running again. If they persist, terminate each distribution individually with wsl --terminate <DistroName>, then run wsl --shutdown.
  • WSL fails to start after shutdown. Run wsl --status to check for errors. If the WSL kernel needs updating, run wsl --update. If the issue continues, try wsl --shutdown again, then restart your computer.
  • “No installed distributions” error when starting. Run wsl --list --verbose to see if your distribution is listed. If not, it may need to be reinstalled. If it is listed but not starting, try wsl --terminate <DistroName> then wsl -d <DistroName>.
  • Network or DNS issues after restart. Restarting WSL often fixes these. If problems persist, run wsl --shutdown again, then check your Windows network settings. In some cases, resetting the WSL network stack with wsl --shutdown and restarting is enough.

Frequently Asked Questions

Does restarting WSL delete my files?

No. Restarting WSL stops running processes but does not delete files in your Linux filesystem. Only unsaved changes in memory are lost.

What is the difference between wsl --shutdown and wsl --terminate?

wsl --shutdown stops all WSL distributions and the WSL 2 virtual machine. wsl --terminate <DistroName> stops only the specified distribution and leaves others running.

Do I need to restart my computer to restart WSL?

No. Running wsl --shutdown and then starting a distribution is sufficient. A full reboot is only needed if WSL is unresponsive or after certain system updates.

How do I restart WSL from inside a Linux terminal?

You can run wsl.exe --shutdown from within WSL if the Windows host path is available, but it is more reliable to use a Windows PowerShell or Command Prompt window.

Will restarting WSL apply changes to .wslconfig?

Yes. Changes to .wslconfig take effect after you run wsl --shutdown and start WSL again.

Can I restart WSL without administrator rights?

wsl --shutdown typically requires administrator privileges. Without them, the command may fail. Use an elevated prompt.

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions