Page 1 of 1

Can't write to shared folder

Posted: 7. Feb 2012, 01:42
by 3beezer
A recent thread (45884) discussed the exact problem I am having, but the solution in that case was to start over with a new VM. It would be painful to do that in my case.

I am trying to use the shared folder capability. The host is Ubuntu Server and the guest is Ubuntu Desktop (10.10 in both cases). VBoxManage is version 4.1.8r75467. I have VBoxGuestAdditions version 4.1.8 installed in the guest.

I created a shared folder using

VBoxManage sharedfolder add guest-os --name shared-folder --hostpath /usr/share/shared-folder/

I mount it from within guest-os using

sudo mount -t vboxsf -o uid=1000,gid=1000 shared-folder /mnt/shared-folder

I am able to read the contents of the folder, but when I try to create a file I get

$ touch test2
touch: cannot touch `test2': Protocol error

When I try to delete a file I get

$ rm test
rm: cannot remove `test': Operation not permitted

The user is in the vboxsf group. Permissions in the shared folder are 644. I get the same error messages when I run the commands as root.

Re: Can't write to shared folder

Posted: 7. Feb 2012, 01:55
by Perryg
What happens if you use a non-system folder instead, like a folder in your ~/home?
What does ls -al say about the groups and owners of the /usr/share

Re: Can't write to shared folder

Posted: 7. Feb 2012, 06:14
by 3beezer
Yup. You got it. The system folder and its contents are owned by root. If I make a copy of the folder and change the ownership to the user, then the shared folder works perfectly.

So, is there a way to share a folder owned by root, or is doing so a security breach?

Thanks for the help.

Re: Can't write to shared folder

Posted: 7. Feb 2012, 15:19
by Perryg
Sure there is always a work-around, but it is a major security risk.