Well, while I had another problem related to my shared folder, I got into this stack question: Shared folder in VirtualBox for Apache
This helped me in two ways, and it seems that I need these uid and gid options.
So, to set the shared folder as another user, I would run:
mount -t vboxsf SHARE_NAME /some/dir -o uid=48,gid=48
Also, to find out what your gid and uid WWW data is, just run id www-data .
If you also need to change permissions on mounted files, just add "dmode" to the parameters, for example:
sudo mount -t vboxsf SHARE_NAME-o rw,dmode=777,gid=GROUP_ID,uid=USER_ID /path/on/guest
Available options: (from mount help):
rw mount read write (default) ro mount read only uid =<arg> default file owner user id gid =<arg> default file owner group id ttl =<arg> time to live for dentry iocharset =<arg> i/o charset (default utf8) convertcp =<arg> convert share name from given charset to utf8 dmode =<arg> mode of all directories fmode =<arg> mode of all regular files umask =<arg> umask of directories and regular files dmask =<arg> umask of directories fmask =<arg> umask of regular files
And if you need it to start during system initialization, just create a file on /etc/init/SOMETHING.conf, with something like this:
description "SOME DESCRIPTION" start on startup task exec mount -t vboxsf YOUR_SHARE_NAME /path/on/guest -o uid=1000,gid=33
dmmd
source share