NixOS-WSL
NixOS-WSL copied to clipboard
Doesn't automount drive letter mounted shares
Bug description
In windows I have SMB shared mapped to drive letters. On the WSL side, I only have physical drive letters (like C) and special driver ones (like google drive), normal SMB shares don't exist.
To Reproduce
Steps to reproduce the behavior: Create a windows share and map it to a drive letter.
Expected behavior
I expect the mapped drive letters to show up under /mnt/
This can be manually fixed with mounting with type drvfs in the filesystems config, but getting the filesystem options (like metadata and uid/gid) correct is error-prone.
Additionally, when I do add the mount options to the filesystems configuration, it doesn't automount on boot (fails), yet, after boot, a sudo mount -a will mount it correctly.
fileSystems."/mnt/z" = { device = "Z:\"; fsType = "drvfs"; options = [ "metadata" "uid=1000" "gid=100" "noatime" ]; };
I'm not aware that this works on any WSL distro, so I'd say this is a bug on Microsofts side and not introduced by us. At least I just tested it on Ubuntu and the network drives aren't present there either
I didn't even know that it's possible network drives through WSL at all, to be honest - so thanks for enlightening me
I have auto-mounting working like this:
fileSystems."/mnt/j" = {
device = "J:";
fsType = "drvfs";
};
Perhaps it doesn't like the \
?
Or was the issue specifically with the options? Never tried mounting with options.
I had guessed that it's because the network drives aren't available yet when NixOS tries to mount then. But the backslash might be a problem as well