I am trying to automount an OS folder (Windows 8) not in the user folder into boot2docker on its init script, but run into the above error.
Mounting works fine when I run it manually:
sudo mount -t vboxsf mydirectory /mapped/mydirectory
But when restarting boot2docker it forgets, so I'm trying to get it automounted to the folder already created in the OS.
Following the instructions, I am trying to get it automounted by the above command inside the script,
/var/lib/boot2docker/bootlocal.sh
which does execute as shown by the boot2docker startup script:
-------------- ran /var/lib/boot2docker/bootlocal.sh
Finished boot2docker init script.
Inside the logs at
/var/log/bootlocal.log
I see the following error:
mount.vboxsf: mounting failed with the error: No such file or directory
As recommended by the documentation I'm using:
I have tried adding to
sudo modprobe vboxsf
as recommended by https://forums.virtualbox.org/viewtopic.php?t=5851 but no avail - the same error occurs.
UPDATE: I figured out the issue. Even though the folders exist on the filesystem, for whatever reason they aren't accessible until post login, so adding the folders in the
/var/lib/boot2docker/bootlocal.sh
like
echo "starting mounting"
sudo modprobe vboxsf
sudo mkdir /mapped
sudo mkdir /mapped/AAA
sudo mkdir /mapped/BBB
sudo mkdir /mapped/CCC
sudo mount -t vboxsf AAA /mapped/AAA
sudo mount -t vboxsf BBB /mapped/BBB
sudo mount -t vboxsf CCC /mapped/CCC
echo " done mounting"
worked, and they now survive restarts. Yay!