Mount / Unmount

How to mount Linux file system using WSL2 on Windows 10

You can now mount a Linux file system on Windows 10 using the Windows Subsystem for Linux 2, and here's how.

WSL2 mount Linux file system commands

Starting with build 20211, the Windows Subsystem for Linux 2 (WSL2) includes a new feature that allows you to attach and mount physical drives to access Linux file systems (such as ext4) that are not natively supported on Windows 10.

The new feature is meant to help you access Linux files using File Explorer on dual-boot system running Windows 10 and a Linux distro on a different drive.

In this guide, you will learn the steps to mount and unmount drives using the Windows Subsystem for Linux 2.

Mount Linux file system on Windows 10

To mount a Linux file system using WSL2, use these steps:

  1. Open Start on Windows 10.

  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.

  3. Type the following command to list the available physical disks and press Enter:

    wmic diskdrive list brief
  4. Confirm the drive path under the “Device ID” column.

  5. Type the following command to mount the Linux file system and press Enter:

    wsl --mount DISKPATH
    Mount Linux file system (source: Microsoft)
    Mount Linux file system (source: Microsoft)

    In the command, make sure to replace DISKPATH for the path of the drive with the Linux distribution you want to mount. For example, wsl --mount \\.\PHYSICALDRIVE2. If you want to mount a specific partition, then you’ll need to use the --partition option with the number of the partition. For instance, wsl --mount \\.\PHYSICALDRIVE2 --partition 1.

Once you complete the steps, the drive with Linux files will mount, and it’ll be visible from Windows 10.

Mount any Linux file system on Windows 10

The previous steps will only attempt to mount a physical drive as ext4. If you want to specify another file system, you’ll need to use a different command with the Windows Subsystem for Linux 2.

To mount a specific Linux file system on Windows 10, use these steps:

  1. Open Start.

  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.

  3. Type the following command to list the available physical disks on Windows 10 and press Enter:

    wmic diskdrive list brief
  4. Confirm the drive path under the “Device ID” column.

  5. Type the following command to mount a drive and press Enter:

    wsl --mount DISKPATH -t FILESYSTEM

    In the command, make sure to replace DISKPATH and FILESYSTEM for the path of the Linux drive and file system you want to mount. For example, to mount a disk as fat, use these command: wsl --mount DISKPATH -t vfat.

After you complete the steps, the drive with Linux files will mount, and it’ll be accessible using File Explorer.

Access Linux file system on Windows 10

To access files from a Linux file system on Windows 10, use these steps:

  1. Open File Explorer.

  2. Click the Linux item from the left navigation pane.

  3. In the address bar navigate to \wsl$ and then access the mount folder. For example, \\wsl$\\DISTRO-NAME\\MOUNT-POINT.

    Linux ext4 access (source: Microsoft)
    Linux ext4 access (source: Microsoft)

Once you complete the steps, you’ll be able to browse the Linux files from a file system that is not natively supported on Windows 10. In addition to using File Explorer, once the drive is mounted, you can access file systems like “ext4” from the WSL2 console using command lines.

Unmount Linux file system on Windows 10

To unmount Linux file system on Windows 10, use these steps

  1. Open Start.

  2. Search for PowerShell, right-click the top result, and select the Run as administrator option.

  3. Type the following command to unmount and detach the drive and press Enter:

    wsl --unmount DISKPATH

    In the command, make sure to replace DISKPATH for the Device ID of the drive you want to unmount.

After you complete the steps, the drive with the Linux file system will unmount and detach from Windows 10.

The feature is available starting with Windows 10 build 20211, and it’s expected to arrive in future releases of the operating system. If you can’t see the new feature, it’s because you’re running the latest preview build available in the Dev Channel.