Access to WSL Filesystem in Explorer

When talking to people about the WSL and accessing their files, I have noticed some are still unaware of just how easy this is. In this short blog post, you will get some tips and tricks to manage your WSL files and directories quickly and easily using File Explorer.

From within WSL

Way back with Windows 10 version 1903 (May 2019), Microsoft added some options to access your files in WSL far more easily. Whenever you are in a directory in WSL that you would like to access from File Explorer, simply type:

$ explorer.exe .

The result will be a new File Explorer window showing your current directory location. The result should be similar to the screenshot below.

 Typeing explorer.exe . in WSL 

Similarly, typing:

$ code .

It opens up a new VS Code window using your current path.

Opening VSCode quickly from WSL

From File Explorer

There is also the option to open your WSL filesystem from the File Explorer itself. In the address bar  type \\wsl$ . The result should be similar to the below image.

Access WSL from a network path.

This works in Windows 10 and Windows 11. Alternatively, in Windows 11, Microsoft also added a nice Linux list item and icon to the navigation pane. Selecting that also shows your available WSL filesystems.

Choosing Linux from the Windows Exploerr.

Powershell

Lastly, it is also possible to quickly the files under WSL from Powershell. It basically requires you to use the same address, \\wsl$, as you would need from the File Explorer, with one very important difference. You are required to append the distribution. Otherwise, Powershell throws an error.

Access WSL files from Powershell.

Conclusion

The WSL is integrated extremely well into Windows. You can access files from anywhere, and there are a lot of handy shortcuts to quickly and easily access files and directories.

Author

Emiel Kremers

Partner at FourCo Specialising in Cloud and Big Data infrastructure.