5

Trying to use veracrypt (console) in WSL.

I make a volume, seems to work OK... but when I try to mount it:

Done: 100.000%  Speed: 5.0 MiB/s  Left: 0 s

The VeraCrypt volume has been successfully created.
m17awl@M17A:/media/mike$ veracrypt /mnt/e/test.vc /media/mike/rsync_vc_drive_e/
Enter password for /mnt/e/test.vc:
Enter PIM for /mnt/e/test.vc:
Enter keyfile [none]:
Protect hidden volume (if any)? (y=Yes/n=No) [No]:
Error: fuse: device not found, try 'modprobe fuse' first

NB have seen this question, but when I try these commands I get this:

m17awl@M17A:/media/mike$ modprobe fuse
modprobe: FATAL: Module fuse not found in directory /lib/modules/4.4.0-19041-Microsoft
m17awl@M17A:/media/mike$ modprobe loop
modprobe: FATAL: Module loop not found in directory /lib/modules/4.4.0-19041-Microsoft
m17awl@M17A:/media/mike$ lsmod
libkmod: ERROR ../libkmod/libkmod-module.c:1668 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory
Error: could not get list of modules: No such file or directory

... obviously these problems may be WSL-specific. I have no idea, and have never heard of these Linux "modules" (am low-level, sorry!).

As a workaround I installed the W10 version of veracrypt console (the point of wanting to use the console version being that I want to mount and dismount from scripts). This also ran into a problem, as documented here, although I've managed to find a sub-optimal way of mounting, here, which at least works...

1

2 Answers 2

2

fuse is not supported in WSL 1

From WSL Issue #2869, a comment by therealkenc

No Linux modules on WSL because no Linux kernel in WSL.


fuse is compiled into WSL 2

From MSPoweruser article Windows Subsystem for Linux (WSL) 2 support coming to Windows 10 version 1903 and 1909

Full Linux kernel built into WSL 2

And from WSL Issue #17, a comment by therealkenc

FUSE is statically compiled into the WSL2 kernel. In general modprobe is not applicable in WSL2 by-design



Credit @Steve Bennett.

5
  • 1
    The Github issue you linked to was for WSL version 1. WSL2 (which had already been available for 18 months when your answer was written) does have a real Linux kernel. Please see this answer for the right explanation. Thanks! Commented Oct 2, 2021 at 21:16
  • That answer doesn't address FUSE though, so it's still not clear whether WSL2 would help. Commented Nov 15, 2021 at 23:00
  • 1
    Ok, this and this make clear that FUSE is compiled into the WSL2 kernel. Commented Nov 15, 2021 at 23:06
  • Thanks @SteveBennett . I updated the answer with your comments Commented Dec 7, 2021 at 3:17
  • WSL2 is unusably so slow, WSL1 doesnt support Fuse, ... nice idea this WSL, but does not work. Commented Sep 27, 2023 at 8:03
2

In WSL 2, the kernel used is a custom build by Microsoft. While it is compiled with support for modules, neither modules nor kernel headers are shipped, and as such, it's not practically possible to load custom modules into the kernel without a lot of work building them yourselves. Note that the kernel modules and headers shipped by your distro are for a different kernel and therefore won't work.

To give a basic rundown on modules, they are essentially drivers, and are used to support hardware (real or virtual), file systems, devices, and all sorts of other functionality, while at the same time keeping the main kernel image small. As a result, they are commonly used by distros. Microsoft does not ship modules for their kernel because the environment is well known and static and distribution is much easier if the functionality is shipped compiled into the kernel.

In order to use a FUSE file system, you'll need to have the /dev/fuse device. From the documentation, it appears that udev may not run to create devices, so you could try to run sudo mknod /dev/fuse c 10 229 to create it, and then see if that works. Supposedly FUSE is available, so that might work.

1
  • 1
    Thanks. Tried that mknod command. Same error. Commented Feb 28, 2021 at 9:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .