First, thank you suomynona, because this was a SUPER super important post and the information was spot on.
It's also extremely important to note for guest OS' like Fedora that you most likely need to disable SELinux.
You can read more about how to do that here: http://docs.fedoraproject.org/en-US/Fed ... Linux.html
Also, you can add users to groups using the command line, usermod -G groupname username
That's a lot better/safer than going into the files under /etc...
In fact, if you just add apache and any other users you want to the vboxsf group (typically 1001 and you can find this out from looking in /etc/group) then you can mount your shared folder w/o specifying a gid and uid. For instance, right now because I didn't pass the -o option, my shared folder is mounted as root:root. Permissions are 777 on the files (I think probably always??). Apache is not in the root group...But despite the fact my shared folder says its root:root...Just belonging to the vboxsf group was enough to have the access.
You can also auto mount by editing (in Fedora and some other distros) /etc/rc.d/rc.local
If that file doesn't exist, at the top you'll want #!/bin/sh and ensure the file is executable (chmod +x) and then under that on a new line put the mount command, so something like:
- Code: Select all Expand viewCollapse view
mount -t vboxsf sharename /path/to/mount
That will auto mount your share on boot. You can also put it in fstab as described above.
The difference? I'm sure the rc.local runs after, but you should get a little more flexibility in the shell script there.
...though if you're trying to run Apache to server content from the mounted drive, you should use fstab. Otherwise the httpd service will fail to start on boot. Again, you could start the httpd service from rc.local ... but might as well do things the "right" way unless you have some strange requirement.