Win 10 Linux Subsystem: Auto-mount network drives
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Luau
--
Chapters
00:00 Win 10 Linux Subsystem: Auto-Mount Network Drives
00:30 Accepted Answer Score 9
00:47 Answer 2 Score 1
01:24 Answer 3 Score 2
01:56 Answer 4 Score 3
02:13 Thank you
--
Full question
https://superuser.com/questions/1293401/...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#windowssubsystemforlinux #networkdrive #automount
#avk47
ACCEPTED ANSWER
Score 9
WSL does process fstab, but only as of build 17093. Assuming you're using an earlier version, you'll probably need to write a script to do the mount and invoke it manually.
ANSWER 2
Score 3
I ran into the same problem.
What I did to fix it was, go to the /etc/bash.bashrc
and add the below script at the top:
sudo rm -r /mnt/d
sudo mkdir /mnt/d
sudo mount -t drvfs D: /mnt/d
Please note that D is my network drive.
ANSWER 3
Score 2
I ran into the same problem.
I am running Windows 10 Enterprise Version 1709, OS Build 16299.431
What I did is I added to the top of /etc/bash.bashrc
the following line:
sudo mount -t drvfs '\\127.0.0.1\MyDrive' /mnt/MyDrive
I am not saying this is the best way to go about it, but I was sure tired of having to mount the drive every time I started WSL bash.
ANSWER 4
Score 1
Windows build 17093 is supposed to fix the fstab problem, but at the moment it is only an Insider Build, so not advised for stability.
You can effectively accomplish this by writing a .bash
_login script in your home directory like this:
if [ ! -e full_file_name ]
then sudo mount --bind ...
fi
Just replace the mount command by whatever mount commands you want, and
full_file_name
with a file-name that will reliably exist if your mounts
are in place.
The first Linux window might require you to type your Linux password, but later windows will not.