How to Access Linux Filesystems in Windows 10 and WSL 2

Windows Subsystem for Linux 2 now allows a physical disk with a Linux filesystem, such as ext4, to be attached and mounted inside WSL 2.

The feature lets users access Linux file systems, such as ext4, that Windows don’t natively support. It also means those dual-booting Windows and Linux with different disks can now access Linux files from Windows.

Starting with Windows build 20211, Windows Subsystem for Linux 2 (WSL 2) will be offering a new feature: wsl --mount. This new parameter allows a physical disk to be attached and mounted inside WSL 2, enabling you to access filesystems that aren’t natively supported by Windows (such as ext4).

Related: How to Use showmount Command to List Shares on an NFS Server

So, if you’re dual-booting with Windows & Linux using different disks, you can now access your Linux filesystem in WSL 2.

However, the feature comes with limitations. For instance, it’s impossible to attach a single partition or mount ext4 partitions on the same physical disk as Windows OS.

This is because the new improvement is only limited to separate physical disks. Also, you cannot attach USB flash drives even though it supports USB disks.

How to Mount a Linux Disk in WSL 2

To mount a disk, open a PowerShell window with administrator privileges and run:

wsl --mount <DiskPath>Code language: HTML, XML (xml)

Listing the available disks in Windows is easy. Just run:

wmic diskdrive list briefCode language: PHP (php)

To unmount and detach the disk from WSL 2, run:

wsl --unmount <Diskpath>Code language: HTML, XML (xml)

The disks paths are available under the DeviceID columns, usually under the \\.\PHYSICALDRIVE* format.

Below is an example of mounting a specific hard disk partition into WSL and browsing its files.

How to mount a Linux disk in WSL 2

Accessing Linux Filesystem with File Explorer

Once mounted, it’s also possible to access these disks through Windows Explorer by navigating to \wsl$ and then to the mount folder.

Accessing files with File Explorer

Bottom Line

If you want to access a Linux filesystem in WSL 2, first update your Windows to the latest Build 20211 and then check out the official docs.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%

3 Comments

  1. Hi,

    I’m using a Luks encrypted BRTFS drive. I managed to mount the drive with “wsl –mount –bare” Afterwards I used
    sudo cryptsetup luksOpen /dev/sdc1 cryptroothd
    sudo mount -o compress=zstd:1 /dev/mapper/cryptroothd /wd12tb
    So the drive is visible within WSL2 but Windows just shows the empty folder without the mounted drive. Do I have to to that in another way or is it not possible to access it from Windows?

Leave a Reply

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