Reboot WSL

Rebooting WSL instances can sometimes be necessary due to random errors, which may only be resolved through a system reboot. However, rebooting directly from within WSL can pose challenges due to the lack of systemd. In this blog, Reboot WSL, we’ll explore a simple solution utilizing the ‘wsl’ command to gracefully shut down WSL and restart it.

If you encounter issues with WSL commands, especially during the uninstallation/reinstallation of Linux distributions, restarting your computer may be necessary for a successful resolution. For issues on an individual WSL distro, the information below might help you.

How to Reboot a WSL Distro

Follow these steps for a WSL reboot, complete with a check on installed WSL Distributions:

# Check installed WSL distros
wsl -l -v

# Reboot WSL distro
wsl --shutdown -d Ubuntu-20.04
WSL Reboot

To start up a WSL distro, we just need to open a new Terminal for that Distro, or run ‘wsl -d kali-linux‘ using the distro name returned from the list command.

Note: The LXSS Manager Service serves as the broker to the Linux subsystem driver. You can also try restart this, but a reboot of your local machine might be what you need to try before continuing to troubleshoot further.

For more information on troubleshooting WSL issues and rebooting, have a look at MS Docs: Troubleshooting Windows Subsystem for Linux

Leave a Reply

Your email address will not be published. Required fields are marked *