How to Reboot a WSL Distro in WSL Version 2

This is a post on how to reboot a Windows Subsystem for Linux (WSL) Distribution on your local machine.

Rebooting your WSL instance is something you might need to do from time to time. It depends on what you’re doing and testing. You may encounter an error message and a reboot resolves the issue.

This example here shows how to do this on WSL Version 2

# check wsl version
wsl -l -v
# reboot wsl2 instance
wsl --shutdown
# enter default wsl instance to boot

You are unable to reboot from within WSL due to the lack of systemd. There are some open-source projects in the works to enable this which you can look out for in GitHub.

If you have multiple Linux Distributions installed on your Windows machine, by default you can only have one of them running, so when you’re switching between using ‘wsl -d <instanceName>’ the other will go offline. There is a way to get multiple WSL instances running at the same time, even with a GUI – have a look at this WSL Distro Manage project in GitHub if of interest.

One last note, the LXSS Manager Service is the broker to the Linux subsystem driver. We can also restart this service or of course reboot our local machine.

Similar Posts

Leave a Reply

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