Setting WSL 2 Start Folder in Windows Terminal - gecko-8/devwiki GitHub Wiki
These steps will show you how to set your WSL 2 start location to the home directory (~) but can be adjusted for any location.
- Open your WSL 2 shell.
- Type the following command to go to your home directory.
cd ~
- Type the following command to get the path of your home folder:
pwd
- Open Windows Terminal and open Settings.
- In your WSL 2 settings under profiles/list, find the WSL 2 profile.
- Note the name of the profile (e.g. Ubuntu-20.04).
- Add a line in the profile like this:
"startingDirectory": "//wsl$/<profile name>/home/<your username>"
- Save the settings and restart Windows Terminal. You're WSL 2 should now open at the ~ folder.