Advertisement

Mount Linux File System in Windows 10

How to Mount Linux File System in Windows 10

WSL 2 is the latest version of the architecture that powers the Windows Subsystem for Linux to run ELF64 Linux binaries on Windows. With recent changes, it allows accessing files stored on a drive with the Linux file system. If you have a drive with Linux installed, you can now mount it in Windows 10 and browse its contents with help of the WSL 2. Here's how it can be done.

Advertisеment

WSL 2 ships a real Linux kernel with Windows that will make full system call compatibility possible. This is the first time a Linux kernel is shipped with Windows. WSL 2 uses the latest virtualization technology to run its Linux kernel inside of a lightweight utility virtual machine (VM). This new architecture changes how these Linux binaries interact with Windows and your computer’s hardware, but still provides the same user experience as in WSL 1.

Starting with Windows Insiders preview build 20211, WSL 2 offers 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). You can also navigate to these files inside of Windows File Explorer.

Here are the steps you need to perform.

  • List the available physical disks in Windows 10.
  • Mount the drive with Linux file system.
  • Browse its content
  • Unmount the drive.

Do it as follows.

To Mount Linux File System in Windows 10,

  1. Open PowerShell as Administrator.
  2. Type the following command to list the available physical disks, and press Enter: wmic diskdrive list brief.Windows 10 List Drives With Wmic
  3. See the DeviceID value to find the required drive.Windows 10 See DeviceID
  4. Type the following command to mount the drive, and press Enter: wsl --mount DISKPATH [--Partition <number>. E.g. wsl --mount \\.\PHYSICALDRIVE2 --Partition 1. Substitute the DISKPATH and Partition values (if the drive has more than one partition) for the path of the Linux drive you want to mount.Windows 10 Mount Linux Drive Via WSL
  5. The drive with Linux files will be mounted, so you can access it with File Explorer.  Type \\wsl$ into the File Explorer's address bar and hit Enter.Windows 10 Access Linux FS In File Explorer
  6. You will see a folder named as the above DeviceID + partition number. Browse it as a regular folder on your hard drive.
  7. Once you finish, close File Explorer, and return to PowerShell. Type the command wsl --unmount <DISKPATH>. E.g. wsl --unmount \\.\PHYSICALDRIVE2.

You are done.

Note that wsl allows specifying the file system type. WSL will try to guess it, but if it fails, when use the command as follows:

wsl --mount \\.\PHYSICALDRIVE2 --Partition 1 -t ext4

In the command above we are telling wsl to mount the drive as the popular Ext4 FS.

That's it.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisеment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

12 thoughts on “Mount Linux File System in Windows 10”

  1. I have tried this and when i use the –mount command it does not do anything but brings up the command for wsl. Any ideas?

        1. He’s right, prerequisites are Windows 11 is required. FML.

          https://docs.microsoft.com/en-us/windows/wsl/wsl2-mount-disk

          “You will need to be on Windows 11 Build 22000 or later to access this feature. You can join the Windows Insiders Program to get the latest preview builds.”

  2. Hi,

    I am getting this error on Windows 11 64bit guest running on Mac OS M1 chip while trying to mount a RHEL vhd data drive image from MS Azure VM.

    PS C:\Windows\system32> wsl –mount \\.\PHYSICALDRIVE1
    wsl.exe –mount is not supported on ARM64.
    Error code: Wsl/Service/WSL_E_WSL_MOUNT_NOT_SUPPORTED

    Any idea how to resolve this?

    Thank you in advance.

    Regards,
    Shov

  3. what is wsl2 ? I tried to mount only the device path cause there aint no partition on my drive, the error message was need wsl2

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.