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.

More articles

[DEV] - How to allow Junie to execute terminal commands in your WSL 2 environment

Learn how to configure Junie to work properly with WSL 2, enabling seamless execution of terminal commands in your development environment.

Read more

[DEV] - How to fix error "SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'"

Occasionally, a WSL 2 with Laravel Valet setup changes the MySQL plugin for user authentication. In this article we'll show you how to switch it back.

Read more

Sign up without commitment and tell us about your project