how to mount shared folder as home on boot

Discussions related to using VirtualBox on Windows hosts.
Post Reply
hedron
Posts: 4
Joined: 18. Jan 2008, 19:06

how to mount shared folder as home on boot

Post by hedron »

I've been able to do this as a hack job in arch, but I am having trouble doing to it a more proper way in slackware. I have added the following to rc.local:

/etc/rc.d/init.d/functions
/etc/rc.d/init.d/vboxadd start
/etc/rc.d/init.d/vboxvfs start
/etc/rc.d/init.d/vboxadd-timesync start
/sbin/modprobe vboxvfs
/sbin/mount -t vboxsf -o uid=1000,gid=100,rw userfolder /home/userfolder

Userfolder is a folder on my Windows XP system. If I do the above manually it works perfectly, but it won't let me do it at boot time. I did a similar method with arch but stuck it in a different file. I also tried sticking similar to the above in other files in the rc.d folder. Also tried a cleaner method using fstab but that didn't work either.

Any ideas? Thanks.
ShellyCat
Posts: 34
Joined: 10. Feb 2008, 15:52

Re: how to mount shared folder as home on boot

Post by ShellyCat »

hedron wrote:/sbin/modprobe vboxvfs
/sbin/mount -t vboxsf -o uid=1000,gid=100,rw userfolder /home/userfolder
I had the same experience with a script to automatically set up Host Interface Networking. I got an error telling me that a module wasn't loaded, but when I checked, it was.

What happens is the operating system reads the script and executes the commands in quick succession. But the actual tasks the operating system must do in response to those commands can take a few seconds. So, it is probably trying to use the module before the module's code has been read, loaded into memory, and exectued!

So, add a sleep command, and a message echoed to the screen like this:

Code: Select all

/sbin/modprobe vboxvfs
echo "Loading vboxfs..."
sleep 3
/sbin/mount -t vboxsf -o uid=1000,gid=100,rw userfolder /home/userfolder 
I just noticed this discrepancy, too:

/sbin/modprobe vboxvfs
/sbin/mount -t vboxsf
Post Reply