2

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!

2
  • BTW, Serverfault is for questions about professional Systems Administration. Development tool questions would be better handled elsewhere.
    – EEAA
    Jun 20 '15 at 0:53
  • Is there any easy way to move this from this site to StackOverflow without reasking it?
    – TroyWorks
    Jun 24 '15 at 21:49

Browse other questions tagged or ask your own question.