\\wsl.localhost\<distro>\; the older \\wsl$\ form still works too. Everything below applies the same with either path.Creating a link between local Windows files and WSL (Windows Subsystem for Linux) is a useful way to share files between the two environments.
In this guide, I’ll show how to link a folder in Windows to your WSL instance using the ln command, and also explain how to remove a linked folder.
> Create a New Linked Folder for WSL
> Create and Modify Files in the Linked Folder
> Remove a Linked Folder
> Final Thoughts
Create a New Linked Folder for WSL
The ln command in Linux is used to create links between files. In this example, we’ll use a symbolic link to share a folder between the Windows file system and WSL.
First, ensure that you’re familiar with the /mnt/c path, which is where your C: drive is mounted in WSL.
To link a folder from Windows (e.g., a projects folder on your C: drive), use the following command:
# create a symlink at ~/projects pointing at C:\projects ln -s /mnt/c/projects ~/projects

The -s flag creates a symbolic link (as opposed to a hard link), allowing you to access the folder in both WSL and Windows.
The screenshot shows the shorter ln -s /mnt/c/projects with no destination. That does the same thing, but only when you run it from your home directory, because ln then names the link after the folder it points at and drops it where you are standing. Naming the destination explicitly is the version that works from anywhere, and it is what the rest of this post assumes.
Create and Modify Files in the Linked Folder
Once the link is created, you can create a folder or a file within your WSL environment that is directly tied to your Windows file system.
For example, in the screenshot below I’m creating a new file within the linked folder:

This has created a folder and a file within the linked projects folder, which is located on my Windows file system.

You can view and modify these files from either Windows or WSL.
Remove a Linked Folder
If you no longer need the link, you can easily remove it. First, list the files to check for existing links, then use the rm command to delete the symbolic link:
# List files in the linked folder to confirm the link ls -lai ~/projects # Remove the symbolic link (only deletes the link) rm ~/projects

Note that using rm only removes the symbolic link in the WSL environment; the original folder and files on your Windows drive remain intact:

Final Thoughts
Creating links between local Windows files and WSL is a simple and effective way to share files between the two environments. However, it’s important to note that using mounted Windows drives for version-controlled projects can lead to issues, like chmod errors. Everything under /mnt/c reports permission 777 for the same reason, which is covered in Access Local Files from Windows Subsystem for Linux (WSL).
For smoother operation, keep version-controlled projects inside the Linux file system and use the link for moving files across rather than for working in. That keeps the flexibility of reaching both environments without putting your builds and Git operations across the boundary.
Related
- Access Local Files from Windows Subsystem for Linux (WSL)
- How to Open WSL Projects in Windows File Explorer
- Setting up SSH Keys in WSL
If SQL Server is part of your day job, my current work lives over at sqldba.blog: production DBA scripts, an error library and the SSMS guide.
Comments
One response to “Create a Link Between Local Windows Files and WSL”
I am a Brazilian programmer. For me the above method worked perfectly on Windows 11 with Ubuntu 22.04. Thanks!