ubuntu - Mount shared folder (vbox) as another user -


i'm sorry ask in here, tried serverfault , didn't answer 4 days.

the related question there: https://serverfault.com/questions/394197/mount-shared-folder-vbox-as-another-user


question:

i'm trying mount vbox shared folder every time ubuntu (10.04) starts.

so, added entry on /etc/init this:

description     "mount vboxsf desktop"  start on startup  task exec mount -t vboxsf desktop /var/www/shared 

seems work, except fact files owned "root", , don't have permission write on folder (neither chmod nor chown seems working).

so, how can make files under shared folder owned www-data user/group?


ps.: main reason me have automatic shared folder, can create/edit files host on guest www folder.

if have better idea that, instead of sharing folder, fell free say.

well, while having issue related shared folder, ended getting stackoverflow question: shared folder in virtualbox apache

it helped me in 2 ways, , seems need uid , gid options.

so, mount shared folder user, run:

mount -t vboxsf share_name /some/dir -o uid=48,gid=48 

also, see www-data's gid , uid, run id www-data.

if need change permissions on mounted files, add "dmode" options, as:

sudo mount -t vboxsf share_name-o rw,dmode=777,gid=group_id,uid=user_id /path/on/guest 

the available options (from mount's help):

rw         mount read write (default) ro         mount read uid       =<arg> default file owner user id gid       =<arg> default file owner group id ttl       =<arg> time live dentry iocharset =<arg> i/o charset (default utf8) convertcp =<arg> convert share name given charset utf8 dmode     =<arg> mode of directories fmode     =<arg> mode of regular files umask     =<arg> umask of directories , regular files dmask     =<arg> umask of directories fmask     =<arg> umask of regular files 

and if need run during system init, create file on /etc/init/something.conf, this:

description     "some description"  start on startup  task exec mount -t vboxsf your_share_name /path/on/guest -o uid=1000,gid=33 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -