English
Appearance
English
Appearance
Many users new to WSL2 run into a "puzzle": the Linux is installed, but why does it "shut itself down" a while after you close the terminal? Why can't it just keep running?
This article first describes this behavior, then explains why Microsoft designed WSL this way, and finally shows how to use WSL Dashboard to start a keep-alive Linux distribution.
Have you experienced the following:
NOTE
WSL2's default "idle timeout" is about 60 seconds: when there are no running processes in the distribution (for example, when you've closed all terminals), the WSL virtual machine shuts down automatically to free up system resources such as memory.
This behavior is WSL2's default design — neither a fault nor an error.
WSL2 runs a full Linux kernel in a Hyper-V lightweight virtual machine (utility VM). Every running distribution genuinely consumes memory resources. If all distributions stayed resident in the background, a machine running several distributions at once would waste hundreds of MB or even GB of memory, slowing the whole system down.
Windows' design philosophy is "allocate resources on demand, release what's not in use":
That's why WSL uses a "start on demand, stop when idle" strategy, returning resources such as memory to the system automatically when they aren't needed. It's like turning off the light when you leave a room: power-efficient, but inconvenient for users who need the light to stay on (persistent services) — and that's exactly where the keep-alive need comes from.
TIP
If you need Linux to keep running (e.g. deploying services, running scheduled tasks, hosting a dev server, etc.), read the next section and use WSL Dashboard to keep your distribution alive.
WSL Dashboard provides two simple ways to keep your Linux distribution running.
In the "Installed Linux distributions" list in WSL Dashboard:
After clicking, the distribution wakes up immediately and keeps running; as long as you don't stop it yourself, it won't be shut down for idling. This method suits temporary keep-alive scenarios where you need Linux running "now".
In the "Installed Linux distributions" list in WSL Dashboard:
Once checked, the distribution starts automatically every time Windows boots/signs in, with no manual action needed — "alive from boot". This method suits scenarios where Linux needs to be online long-term (such as dev servers or resident services).
TIP