Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Windows Access Linux WSL Files: Full Guide

· 5 min read · Home Tech

In this article
  1. What Is WSL and Why File Access Matters
  2. How to Access WSL Files from Windows
  3. Why You Should (and Shouldn't) Access Linux Files from Windows
  4. Performance: Why the Linux Filesystem Is Faster
  5. Common Problems and How to Fix Them
  6. Alternatives to the Built-In File Sharing
  7. Frequently Asked Questions

Yes, Windows can access Linux files inside the Windows Subsystem for Linux (WSL) through the \\wsl$ network path or by opening the Linux distribution's folder from File Explorer. You can read, write, copy, and delete files between Windows and your WSL distributions, though performance varies depending on which filesystem you use.

What Is WSL and Why File Access Matters

The Windows Subsystem for Linux (WSL) is a compatibility layer that lets you run a full Linux user space—typically Ubuntu, Debian, or openSUSE—directly on Windows without a virtual machine. It gives developers a native Linux terminal, package manager, and command-line tools while keeping the convenience of the Windows desktop. Since WSL stores its files in a virtual disk (ext4.vhdx), they are not directly visible in Windows Explorer by default. That is why Microsoft built a dedicated file-sharing bridge so you can move files between the two environments without copying them over a network.

How to Access WSL Files from Windows

There are two primary ways to reach your Linux files from Windows: the hidden network share and the File Explorer shortcut.

  • Use the \\wsl$ path: Open File Explorer, type \\wsl$ in the address bar, and press Enter. You will see a list of installed distributions (e.g., Ubuntu, Debian). Click one to browse its entire Linux filesystem.
  • Use the File Explorer shortcut: In the WSL terminal, run explorer.exe . (with a dot). This opens a Windows Explorer window at the current Linux directory. Alternatively, click the Linux penguin icon in the File Explorer sidebar (if you have WSL installed) to jump straight to the default distribution.

Once you are in, you can drag-and-drop files, copy, edit, and delete them just like any Windows folder. The path looks like \\wsl$\Ubuntu\home\username\project.

Why You Should (and Shouldn't) Access Linux Files from Windows

Accessing WSL files from Windows is convenient for quick edits, moving a file to the Windows desktop, or opening a Linux-created file in a Windows app (like a screenshot or a PDF). However, you should be careful about where you store your actual work. Microsoft recommends keeping project files in the Linux filesystem (inside your home directory) for best performance. If you edit Linux files with Windows tools, you can run into line-ending or permission issues, and the file may become slow to access because of the conversion layer.

Performance: Why the Linux Filesystem Is Faster

When you access Linux files through \\wsl$, Windows translates every file operation into a Linux system call. That translation adds overhead, so reading or writing large numbers of files can be noticeably slower than working inside the Linux filesystem directly. Conversely, if you store your project on a Windows drive (like C:\) and access it from Linux via /mnt/c, the same translation happens in reverse, and it is even slower because of the 9P protocol used for that mount. The rule of thumb: keep your code and data in the Linux filesystem (e.g., /home/username/project) and use Windows tools only when you need to, not as your primary workspace.

Common Problems and How to Fix Them

Here are the typical issues you might encounter and their straightforward solutions.

  • \\wsl$ does not show any distributions: Make sure you have at least one WSL distribution installed and that WSL is running. Open a terminal and run wsl --list to verify.
  • Permission denied when editing a file: Linux file permissions are enforced. If a file is owned by root, you may need to change ownership from the Linux side (e.g., sudo chown username file).
  • File is locked or in use: If a Linux process (like a server) has the file open, Windows may not be able to overwrite it. Close the process first.
  • Slow performance on large folders: This is expected. Move the folder into the Linux filesystem if you need speed, or use a Windows-native tool for bulk operations.

Alternatives to the Built-In File Sharing

If the built-in \\wsl$ method does not meet your needs, you have a few other options:

  • Set up an FTP or SSH server inside WSL: You can install an SSH server in your distribution and connect to it from Windows using a tool like WinSCP or FileZilla. This works over localhost and gives you a familiar remote-file interface.
  • Use a shared folder on the Windows side: Create a folder on C:\ and access it from Linux via /mnt/c/yourfolder. This is easy but suffers from the same performance penalty as the reverse.
  • Use a version control system (Git): For code, the cleanest workflow is to keep the repository in Linux and push/pull to a remote, then clone it on Windows if needed. This avoids direct file sharing altogether.

Frequently Asked Questions

Can I access WSL files from Windows Explorer without typing \\wsl$?

Yes. Once WSL is installed, a Linux icon appears in the File Explorer navigation pane. Clicking it shows your installed distributions, and you can browse into them directly. You can also pin a specific Linux folder to Quick Access for even faster access.

Is it safe to edit Linux files with Windows Notepad or VS Code?

Yes, but be aware of line endings. Windows editors may convert LF (Linux) line endings to CRLF (Windows), which can break shell scripts or config files. Most modern editors (like VS Code) detect the file type and preserve line endings, but always check the bottom-right corner of the editor. If a script fails with "\r" errors, run dos2unix filename in Linux to convert it back.

Why can't I see my Linux files in Windows when I browse to C:\Users?

Because WSL files are not stored in your Windows user folder. They live inside a virtual hard disk file (ext4.vhdx) that is hidden in your AppData folder. You should never try to edit that .vhdx file directly—use the \\wsl$ path instead.

Does accessing WSL files from Windows work with WSL 1 and WSL 2?

Yes, both versions support the \\wsl$ path. However, WSL 1 uses a different translation layer (it maps Linux system calls to Windows), so file access is generally faster for cross-operating-system operations, but WSL 2 offers better Linux kernel compatibility. For most users, WSL 2 is recommended, and the file-sharing feature works the same.

Can I move a Windows folder into WSL to speed up my project?

Yes. Copy the folder from Windows (e.g., C:\Users\You\project) to your Linux home directory using the \\wsl$ path or the cp command in Linux. After that, work inside Linux for the best performance. You can delete the Windows copy once you confirm everything works.