Run WSL 2 on system boot
Martijn | Developer
If you notice that WSL 2 is not running when your system (re)boots, you might want to schedule it to run automatically at each logon.
Tip
Didn't install WSL 2 yet? Make sure to check out this article first.
Here’s how to configure this using Windows Task Scheduler.
Step 1 - Open Task Scheduler:
Search for “Task Scheduler” or run taskschd.msc
.
Step 2 - Create a Basic Task
Navigate to the "Action" menu and select "Create Basic Task...".
Step 3 - Configure the task
Enter the following details (you can also enter whatever you want).
Name: "WSL 2"
Description: "Auto-start WSL 2 on boot."
Step 4 - Set the trigger
Choose At log on under the "Trigger" tab.
Step 5 - Define the Action
Select "Start a program" in the "Action" tab.
Step 6 - Define program details
Enter the following details (change disk if necessary).
Program/script: C:\Windows\System32\cmd.exe
Add arguments (optional): /c start /min wsl.exe
Step 7 - Finishing up
Click “Finish” to save your task. WSL 2 will now launch minimized at each logon.