Not long ago, something that seemed impossible in other times it happened: Windows 10 integrated its own Linux kernel into the operating system. It is not a virtual machine, but a Linux kernel built by Microsoft itself, specially designed to integrate with Windows 10.
This kernel landed with the May 2020 Update and is the fundamental feature of the new Windows Subsystem for Linux 2, or WSL 2. This version allows you to do things like access the Linux file system from the Windows 10 file explorer, but Microsoft hasn’t left it there, and WSL 2 is already capable of mounting physical disks so that we can access other file systems.
WINDOWS 10: 9 VERY USEFUL and LITTLE KNOWN TRICKS
Access your Linux files from Windows 10 when you have dual boot
The important detail here is that we are talking not about the Linux file system in WSL 2, but we are talking about mounting a separate physical disk, one where you have a separate install of a distro and being able to mount it on WSL 2 to access files.
For example, if you dual boot Windows 10 and Ubuntu on your computer, it is not normally possible to access the files on the disk you have in Ubuntu within Windows 10, since Ubuntu uses a file system like ext4 that is not supported by Windows 10.
Once mounted, the files on that disk can be accessed directly from Windows Explorer
With WSL 2, you could mount the disk and thus access the files for that Ubuntu installation. This is thanks to the new feature
wsl --mount within WSL 2 that has become available to Insiders with Windows 10 build 20211.
To mount a disk you must use PowerShell with Administrator privileges. Just use the command
wsl --mount followed by the disk path. To list the available disks you can use the command
wmic diskdrive list brief.
By default the command will always try to mount the disk as an ext4 partition, to specify another type of file system or read about more advanced scenarios, you can read the official Microsoft documentation.