Linux host & guest: permission problem on shared folder

Discussions related to using VirtualBox on Linux hosts.
Post Reply
kikinovak
Posts: 5
Joined: 20. Aug 2008, 16:45

Linux host & guest: permission problem on shared folder

Post by kikinovak »

Hi,

I'm running CentOS 5.2 (RHEL 5 clone) inside CentOS 5.2, with guest additions installed. Everything runs fine, except a small permission problem for sharing folders.

On my host, I have defined a folder ~/VBoxShare. I defined it as a shared folder for my virtual machine.

In my guest system, I create a folder ~/shares, so it belongs to kikinovak:kikinovak.

When I try to issue the mount command, I get the only-ROOT-can-do-that reply as expected. So I mount the share as root, as shown in the manual:

# mount -t vboxsf VBoxShare /home/kikinovak/shares

Which works OK, only now my ~/shares directory belongs to root:root. Now when I su - to root and chown -R kikinovak:kikinovak /home/kikinovak/shares, I can't seem to do that. It insists of staying root:root.

Now what can I do to make that shared directory accessible to my normal user?
kikinovak
Posts: 5
Joined: 20. Aug 2008, 16:45

Post by kikinovak »

I'll answer that myself. I just found out after some more fiddling.

Code: Select all

$ id
uid=500(kikinovak) gid=500(kikinovak)
$ su -
Password:
# mount -t vboxsf -o uid=500,gid=500 VBoxShare /home/kikinovak/shares
That did the trick.
Post Reply