WSL 2 on Windows10
Windows allows now to mount physical disks using the Windows Subsystem for Linux 2 (WSL).
For people who are not familiar with WSL2:
... Windows Subsystem for Linux is a compatibility layer for running
Linux binary executables natively on Windows 10 and Windows Server
2019. In May 2019, WSL 2 was announced, introducing important changes such as a real Linux kernel, through a subset of Hyper-V features. ...
find more on Wikipedia
The Windows 10 WSL2 now supports a mount command for linux filesystems called wsl.
First of all you have to install WSL2 on your windows10+ release. I recommend to simply follow the microsoft installation guide.
Now you can use apt commands as common on ubuntu/debian systems
sudo apt install cryptsetup
and use thecryptsetup luksOpen
command.
Previous WSL didn't support CRYPT, and you had to recompile the kernel. To check if DM_CRYPT is supported on your system, open a wsl2 terminal and type the following command:
cat /proc/config.gz | gunzip | grep CONFIG_DM_CRYPT
The output should be CONFIG_DM_CRYPT=y
without a hash (#
), and =y
should be set.