I don't want to permanently map remote disks from production systems, I want to click on shortcut to map the disk and than click another shortcut to unmap it. The sshfs works fine when used from Bash. However when I run the command from shortcut with wsl.exe, it maps the disk but as soon as the command ends, mapping is removed. This can be replicated by running wsl.exe from PS:
PS C:\Users\user> wsl.exe --user root -- sshfs -o allow_other,default_permissions,ro user@machine:/path /mnt/path `&`& read -p "Press enter to continue"
After the sshfs is executed, I can see that the disk is mapped but when I press enter, the disk is unmapped. It seems that there is some kind of "console session" and the mapping is related to the session only, once the session ends, the mapping ends.
I have no idea what's going on, I am missing something simple but fundamental. Thank you for any pointers. And no, using bash.exe does not fix the problem.
\\wsl$\..., but that doesn't seem to work for mounts. – NotTheDr01ds May 19 '21 at 22:07