Ask Your Question

virtualbox shared folders can't change permissions

asked 2015-07-13 06:03:19 -0500

sinux1 gravatar image

I installed a Centos 6.6 VM using Virtualbox. I created a shared folder (permanent) and selected auto-mount. I checked /media and it was not there so I manually mounted it to /home/Sinux/share and it was mounted. Problem is when I try to open it it denies me and says I don't have the permissions necessary. I can access it as root... so I tried to change the permissions graphically but they don't hold. I change the owner, the group and it immediatly goes back to root.So I used the command line... I had to do it as root because I wasn't in the sudoers file... but even then it doesn't stick. I used the command line to add Sinux to the vboxsf group but ti wouldn't stick. I added to root group, wheel, nothing would take hold. Then I used gedit to edit the sudoers file and when I tried to save it I couldn't because it said it was a read only disk or something...? But I could create , save , modify other files.... I don't know what to do. Has anybody else had any experience trouble shooting this? I'm a total newb, and this is frustrating me ( it sure is teaching me a lot though... love the command line)

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2015-07-13 18:41:53 -0500

sinux1 gravatar image

Ok, in the interest of answering my original question, basically why could Sinux not access the shared folder... well, Sinux can... just not from the path that created when mounting. Only root seems to be able to access that specifically... but because 'auto-mount' was selected, that same shared folder is in /media with a sf prefix (as described in the documentation). So two paths to the same folder but only root can access one of them. I still need to figure out my permissions and sudo problems...

edit flag offensive delete link more

answered 2015-07-13 13:36:20 -0500

updated 2015-07-13 14:40:43 -0500

First check if you have installed the Virtualbox Guest Additions.

then create the shared folder : /home/Sinux/share => ok

Check the folder permission, for example : drwxrwxr-x. and owner Sinux

In VirtualBox, select your virtual machine, settings > Shared Folders and add the folder, auto-mount and full access => to be verified

In the Terminal :

  1. usermod -a -G vboxsf Sinux

  2. sudo mount -t vboxsf enlightened /home/Sinux/share/

That should be fine ! You can find more information in the documentation

PS : to edit /etc/sudoers use sudo visudo which controls the syntax..

edit flag offensive delete link more


For gedit /etc/sudoers and Sinux ALL=(ALL) ALL, that works but it's not the best practice. sudo visudo is safer because it will raise a warning if there is a problem when saving the file. Then uncomment the line %wheel ALL(ALL) ALL and add you user to the wheel group (sudo vi /etc/group and add Sinux to the existing line : wheel:x:10:Sinux

yolo gravatar imageyolo ( 2015-07-13 19:16:40 -0500 )edit

I had to change the /etc/sudoers file from read only to read and write... I don't know how to do it from command line so I logged in as root and did it graphically. I was able to add Sinux ALL=(ALL) ALL to it , uncommented %wheel ALL(ALL) ALLand save it (reverting it to read only when I was done). Then I went to the /etc/group file , modified it, and saved it. Sinux can now use sudo. Thank you for all of your help. @yolo , you've helped a lot with more than one of my questions. Thank you.

sinux1 gravatar imagesinux1 ( 2015-07-14 01:31:48 -0500 )edit

Question Tools

1 follower


Asked: 2015-07-13 06:03:19 -0500

Seen: 3,496 times

Last updated: Jul 13 '15