Quick Tip – Rebooting WSL on your windows machine

So being a developer means that we regularly move fast and break things. Especially when you develop the way I do which is “I don’t know, let’s try!” So recently I was working on several projects at once, and needed to reboot my WSL instance. I had done something to it, and the terminal and VSCode would just hang and never connect.

So a quick tip is how to reboot your WSL without rebooting your windows machine.

Step 1 – Run the following command to shutdown WSL:

wsl --shutdown

Step 2 – Run the following command to see the wsl distro’s that are installed:

wsl -l -v

This will return the configured and installed distros:

  NAME              STATE           VERSION
* Ubuntu-22.04      Stopped         2
  docker-desktop    Stopped         2

You can then either start wsl by just opening a new terminal window for your WSL instance.

Leave a Reply

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