This is a small note, but it is the kind of small note that saves a future half hour.
The symptom was:
| |
The useful answer is simple: that is not a valid WSL config key.
What to Do Instead
If you want WSL to start automatically, use one of the Windows startup mechanisms instead of inventing a .wslconfig setting.
Option 1: Task Scheduler
If you want WSL to start quietly in the background:
- Open Task Scheduler.
- Create a task that runs
At log on. - Use
wsl.exeas the program. - Pass
-d <DistroName>as the argument.
That is the cleaner option when you do not want a terminal window appearing at login.
Option 2: Startup Folder
If you want the simplest path and do not mind a window opening:
- Press
Win + R - Run
shell:startup - Create a shortcut to
wsl.exe
That starts the default distro when you log in.
Closing Thought
This is not a deep WSL article. It is just a reminder that when a config key does not exist, the fix is not to search for a more magical config key. Sometimes the real answer is to use the operating system feature that was meant for the job.