I can't get WSL2 to mount my network storage automatically (Ubuntu 20.04)
- Setup /etc/fstab to mount the drives, which works with "sudo mount -a", but doesn't work as a cron task since...
- cron service doesnt't start automatically in WSL2 apparently
- Using /etc/wsl.conf to set automount stuff works fine for drvfs (local drives), but not for networked ones
- Passing the drive as mapped to Windows (Z: drive) to WSL works automatically via drvfs as well, but causes weird permission errors, and I want this to be platform agnostic wherever I deploy it, so not wanted
It does work if I manually log in and do "sudo mount -a" or "service cron start" but where's the fun in that? Looking for the most straightforward not-silly way to do this. I'm testing out hosting my plex stack in WSL2 so the mounts need to work if the computer reboots and stuff.
No, first time trying this
Ubuntu 20.04 WSL2 instance on Windows 10 Pro (10.0.19042 - Build 19042)
Not really important
I have Googled and read the FAQ:
Tatsuta Age fucked around with this message at 14:07 on Nov 24, 2020
|# ? Nov 24, 2020 04:49|
|# ? Jan 18, 2021 15:11|
So I did this a real lazy way and just set my user in sudoers to not need a passwd to do mount, and then added mount -a to my .bashrc. Kinda sucks but whatever.
|# ? Nov 25, 2020 16:27|