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.
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,
- Open PowerShell as Administrator.
- Type the following command to list the available physical disks, and press Enter:
wmic diskdrive list brief
. - See the
DeviceID
value to find the required drive. - Type the following command to mount the drive, and press Enter:
wsl --mount DISKPATH [--Partition <number>
. E.g.wsl --mount \\.\PHYSICALDRIVE2 --Partition 1
. Substitute theDISKPATH
andPartition
values (if the drive has more than one partition) for the path of the Linux drive you want to mount. - 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.
- You will see a folder named as the above DeviceID + partition number. Browse it as a regular folder on your hard drive.
- 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:
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?
I think it is still the wsl 1 that you use. It’s not yet available as I could see, only in beta testing builds.
He is using windows 11, not 10. This command is only available in windows 11.
The command is part of WSL2, regardless of the OS version. Period.
This is incorrect. While the command is available, the –mount option is not understood
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.”
Invalid command line option: –mount
More details please. Are you sure you have WSL 2 installed?
Same issue, Windows 10, had previously installed wsl a while back.
wsl –update
fixed it for me.
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
The mount option is not supported on ARM64. You cannot do anything.
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