Posts Fixing WSL Launcher Configuration When It Breaks
Post
Cancel

Fixing WSL Launcher Configuration When It Breaks

Fixing WSL Launcher Configuration When It Breaks

Sometimes, after some updates or changes, the WSL launcher configuration gets lost or corrupted. This can cause your Windows Subsystem for Linux (WSL) to not start correctly when you click on the tabs in your terminal. However, there’s an easy fix to restore the functionality.

If your WSL tabs no longer work, you might notice that the Command Line field under the settings is blank or incorrect. You can still manually start WSL using the command:

1
wsl -d Ubuntu-24.04

However, this can be inconvenient if you’re used to starting it from the tabs. Here’s how you can fix the WSL launcher configuration to get it working from the tabs again.

Step 1: Access the WSL Tab Settings

Open your terminal and go to the Settings. Locate your WSL distribution (for example, Ubuntu-24.04) and click on it to open its settings.

Step 2: Fix the Command Line Parameter

In the settings for your WSL distribution, look for the Command Line field. If it’s missing or incorrect, you need to update it with the correct launcher for WSL.

In the Command Line field, set the value to:

1
C:\Windows\System32\wsl.exe -d Ubuntu-24.04

Make sure to replace Ubuntu-24.04 with the exact name of your distribution.

Step 3: Set the Initial Directory (Optional)

If you want WSL to start in a specific directory, you can configure the Starting Directory. To set it to your WSL user’s home directory, add the following in the Starting Directory field:

1
/home/jcottobboni

Make sure to replace jcottobboni with your actual WSL username.

Step 4: Save Your Changes

Once you’ve updated the Command Line and Starting Directory fields, click Save. Now, when you click the WSL tab in your terminal, it should start the correct WSL distribution without any issues.

Conclusion

By following these simple steps, you can restore the functionality of your WSL launcher and make sure your distributions start correctly from the terminal tabs. This ensures you can continue using WSL without having to manually enter commands each time.


References:

This post is licensed under CC BY 4.0 by the author.