[solved] Problem with permissions on vboxsf media Kubuntuguest, how to fix?

Discussions about using Linux guests in VirtualBox.
Post Reply
boospy
Posts: 13
Joined: 23. Jun 2016, 08:22

[solved] Problem with permissions on vboxsf media Kubuntuguest, how to fix?

Post by boospy »

Hello,

we have the problem that we find no way to set permissions on the shared folder. I know when the user is in the group vboxsf it is working fine. But us Problem is the with many clients an about 600 Users, so we can't add every user to the local group. The clients are bind to Microsoft ADS. The group vboxsf is added with right GUID to the ADS and all users are member of the group, this is also not working.
How can i set permissions to the shared folders?

Maybe there is an special option to following command:

Code: Select all

VBoxManage --nologo sharedfolder add $MACHINE  --name media --hostpath /media --automount
But we didn'd find something...

Thanks a lot
Last edited by boospy on 27. Jul 2016, 17:17, edited 1 time in total.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Problem with permissions on vboxsf media Kubuntuguest, how to fix?

Post by Perryg »

Not with automount AFAIK. With a permanent manual mount you can specify the group to use but remember that Windows host permissions trump anything else so keep that in mind and adjust accordingly.
boospy
Posts: 13
Joined: 23. Jun 2016, 08:22

Re: Problem with permissions on vboxsf media Kubuntuguest, how to fix?

Post by boospy »

We triyed this too: https://www.virtualbox.org/manual/ch04. ... redfolders
You mean that?

We have done this line in FSTAB:

Code: Select all

media          /media/sf_media         vboxsf             defaults,auto     0       0
The error on auto or manual mount is:

Code: Select all

/sbin/mount.vboxsf: mounting failed with the error: Protocol error
in journal at the same time this error:

Code: Select all

Jul 25 16:45:43 kubuntu-test kernel: sf_read_super_aux err=-71
Jul 25 16:45:43 kubuntu-test kernel: sf_read_super_aux err=-71
Jul 25 16:45:43 kubuntu-test kernel: sf_read_super_aux err=-71
The vboxmanageline:

Code: Select all

VBoxManage --nologo --transient sharedfolder add $MACHINE  --name media --hostpath /media --automount
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Problem with permissions on vboxsf media Kubuntuguest, how to fix?

Post by Perryg »

Not really. I use standard Linux mount statements with options to control the permissions.

Code: Select all

#mount -t vboxsf -o rw,uid=1000,gid=1000 <share> <mount point>
Changing the uid to the user that actually controls the starting of the guest and gid to the group you want to allow ( hint users )

Auto mounting should still be achievable using /etc/rc.local on any *Ubuntu machine.
boospy
Posts: 13
Joined: 23. Jun 2016, 08:22

Re: Problem with permissions on vboxsf media Kubuntuguest, how to fix?

Post by boospy »

Did you set option in vbox for the share too?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Problem with permissions on vboxsf media Kubuntuguest, how to fix?

Post by Perryg »

boospy wrote:Did you set option in vbox for the share too?
Not sure what you mean but the only thing that is done on the VBox side is to share and make it permanent ( without auto-mount )
The rest is done in the guest.
boospy
Posts: 13
Joined: 23. Jun 2016, 08:22

Re: Problem with permissions on vboxsf media Kubuntuguest, how to fix?

Post by boospy »

Tested here on a new guest, manual mount inside vm is working but not the permissions:

Code: Select all

mount -t vboxsf -o umask=022 Downloads /media/
Should set the permissions from media to 777, but does not work. Must i set something special options?

Supplement: Maybe it works with the group domain-user, i'll check this tomorrow.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Problem with permissions on vboxsf media Kubuntuguest, how to fix?

Post by Perryg »

I sent what I use and know works.
boospy
Posts: 13
Joined: 23. Jun 2016, 08:22

Re: Problem with permissions on vboxsf media Kubuntuguest, how to fix?

Post by boospy »

With the mount i can use all devices with read only but permissions are:

Code: Select all

mount -t vboxsf -o rw,gid=plugdev Downloads /media/

Code: Select all

ls -l /media/usbstick_gg  root:plugdev  rwxrwxr x
I can also use audio,... all groups that are set in /etc/security/group.conf

So it should work for the group plugdev, and yes i can read, but not write
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Problem with permissions on vboxsf media Kubuntuguest, how to fix?

Post by Perryg »

Interesting choice. Using removable media and plugdev....

Linux handles removable media a lot different than a common share in /mnt ( common ) or ~/ ( individual user ).

Try a normal share ( not USB or other removable media ) and mount it in /mnt then give the option for users as group.
boospy
Posts: 13
Joined: 23. Jun 2016, 08:22

Re: Problem with permissions on vboxsf media Kubuntuguest, how to fix?

Post by boospy »

Ok, it is working now, this are my options on the Virtuablboxhost:

Code: Select all

VBoxManage --nologo --transient sharedfolder add $MACHINE  --name media --hostpath /media
And the mountcommand in rc.local

Code: Select all

sleep 15 # because of Domain availability
mount -t vboxsf -o rw,gid=domainuser media /media/
The group must be a domain or ldapgroup. Then it is working fine. Local groupmapping with winbind over securityconfig does not work.

Thanks and Best Regards
Post Reply