Home » How To » How to Change the Default Starting Directory for WSL

How to Change the Default Starting Directory for WSL

When you launch a Linux distro in WSL (Windows Subsystem for Linux), it by default, starts in the C drive or current working directory of the process. i.e., C:\Windows\System32. But, you can customize this starting location. Using the terminal settings, you can easily change the default starting directory for any Linux distro in WSL. For instance, I’ve configured my WSL Ubuntu to open directly in the user’s home directory.

In this quick and straightforward tutorial, I’ll guide you through the steps to set your preferred starting directory for WSL. Let’s get started.

Good to know: How to change default Linux distro in WSL

Change Default Starting Directory for a Linux Distro in WSL

  1. Right-click the “Windows” icon on the taskbar.
  2. Select “Terminal“.
  3. Click the down arrow on the title bar.
  4. Select “Settings“.
  5. Select the Linux distro on the left sidebar.
  6. Click the “Starting directory” option.
  7. Click “Browse“.
  8. Select the directory of your choice and click “Select Folder“.
  9. Click “Save“.
  10. With that, your Linux distro starts in the selected custom directory.

Detailed Steps (With Screenshots)

First, open the Terminal application. To do that, right-click the “Windows” icon on the taskbar or press the “Windows key + X” shortcut and select “Terminal”.

open terminal from the power user menu

In the Terminal window, click the down arrow icon on the title bar and select the “Settings” option. Alternatively, press the “Ctrl + ,” shortcut. This opens the Settings tab.

open terminal settings

Once the Settings tab opens, select the Linux distro of your choice from the sidebar. Here I’m selecting the “Ubuntu” distro. Next, click the “Starting directory” option on the right panel.

click starting directory

Next, click the “Browse” button.

Note: If you want to set your Linux home directory (~) as the starting directory, type %USERPROFILE% in the blank directory.

click browse to add starting directory in WSL

Now, select the folder you want to set as the default directory and select the “Select Folder” button.

select direcctory

Finally, click the “Save” button and you are done.

click save to change the default strating directory in WSL

From now on, whenever you open the WSL terminal, it starts in the directory you chose. For instance, I chose to start in the home directory, so it starts with that. If you want to check, run the pwd command.

That is all. It is that simple to change the starting directory in WSL. If you have any questions or need help, comment below. I’ll be happy to assist.

Leave a Comment

Your email address will not be published. Required fields are marked *