Occasionally WSL hangs on Windows 10. Opening "Ubuntu" bash just hangs. Any way to restart WSL without rebooting Windows ?
10 Answers
44
votes
30
votes
6
votes
5
votes
From the windows command prompt, issue wslconfig /L to see the list of registered distributions.
C:\Users\Manoj>wslconfig /L
Windows Subsystem for Linux Distributions:
Ubuntu-16.04 (Default)
Now issue wslconfig /t
C:\Users\Manoj>wslconfig /t Ubuntu-16.04
You can then see the Ubuntu instance getting terminated.
manoj@Manoj-Laptop:~$ The Windows Subsystem for Linux instance has terminated.
Press any key to continue...
Hope this helps.
5
votes
Assuming your wsl distribution name is Ubuntu
.
You can use wsl
command in Command Prompt
(cmd) to find out distribution names and terminate / shutdown / restart a specific distribution.
Restart in sense that you shutdown your wsl distribution and start it again.
- Open cmd.
- Use
wsl -l
orwsl --list
to list / show all installed distributions. It'll give you output like this. The(Default)
is not part of name, just a marker.
Windows Subsystem for Linux Distributions:
Ubuntu (Default)
Ubuntu-20.04
Ubuntu-18.04
- Terminate / shutdown your desired distribution using
wsl -t
orwsl --terminate
like
wsl --terminate Ubuntu
and it will start automatically next time when you open it.
4
votes