Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

WSL paths in Windows

📅 2019-Jun-13 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ path, wsl ⬩ 📚 Archive

Windows Subsystem for Linux (WSL) allows you to install Linux distributions such as Ubuntu under Windows and use them just like using a native Linux system using a Linux shell. Sometimes, I find it useful to access the files and directories that are in the WSL-Linux from Windows Explorer outside. The root filesystems of the Linux installations inside WSL can be viewed and accessed through Windows Explorer. You can even pin this root filesystem (or any subdirectory) inside Windows Explorer if you like to access it frequently.

Do note that the paths where this root filesystem appears in Windows has changed between WSL1 and WSL2 (see below). Other caveats include simultaneous read-write of files between Windows and WSL can be flaky, so can writing a WSL file from Windows.

WSL2

The root filesystems of your Linux installations in WSL2 appear under \\wsl$ in Windows Explorer.

For example:

WSL1

The root filesystem you see under WSL is located at a directory inside %LOCALAPPDATA% in Windows.

For example:


© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 @codeyarns@hachyderm.io📧