I have openSUSE 12.2 in VirtualBox and I tried adding the mount command in /etc/fstab but it doesn’t mount the folder on startup. The command DOES work if i run it with sudo in a terminal.
Next, for each folder I want to share, I must add the folder name to my VirtualBox configuration and I normally allow a read/write ability. Then, in the after.local file in the guest I add, per shared folder:
if ! -d /folder_name ] ; then
mkdir /folder_name
fi
mount -t vboxsf folder_name /folder_name -o defaults
I do this for each folder I want to share and it works great. I keep an example external in the host and just copy/paste over the info after the guest is up and running.
What’s the benefit of this over using fstab? I see the benefit for wanting to create new folder if it doesn’t exist, but since I already created it, isn’t it just easier to put the one line in fstab? (I might be missing something)