User Tools

Site Tools


windows:windows-subsystem-for-linux:keep-wsl-alive

This is an old revision of the document!


How to keep wsl alive

After closing the terminal in which wsl was opened, it goes away. To keep it open, follow these steps:

Run wsl at windows startp

Run taskschd.msc and define a new task:

General → Name → Start WSL General → Security options → Run only when user is logged on General → Security options → Run with highest privileges General → Hidden General → Configure for: Windows 10

Triggers → At log on

Action → Start a program Action → Settings → Program/script: wscript.exe Action → Settings → Add arguments: “C:\wsl_keepalive.vbs” (you can change the path)

wsl_keepalive.vbs
CreateObject("Wscript.Shell").Run "wsl.exe --exec dbus-launch true", 0, False
windows/windows-subsystem-for-linux/keep-wsl-alive.1774019794.txt.gz · Last modified: by odefta