Access group-rw directories via Shared Folders

Discussions related to using VirtualBox on Linux hosts.
Post Reply
maksik
Posts: 2
Joined: 31. Oct 2014, 15:04

Access group-rw directories via Shared Folders

Post by maksik »

Hi,

Looks like VirtualBox ignores group permissions while accessing SharedFolders.

I'm running VirtualBox on a file server under a user vbox. There are a range of shared access directories on that server where files and directories are owned by the respective users and shared with their groups. The user vbox is a member of all these groups. If I log in as a user vbox (via shell or ssh) I can access the files without any problems.

However, access to these resources via the SharedFolders feature VirtualBox does not seem to work. From my Windows guest I cannot read files unless they are owned by the user vbox or readable for all. The same goes with write permissions and directory access permissions.

I've seen many posts in the net regarding the umask and permissions on files created via the SharedFolder when guest creates files and directories. Although these problems are related, the access problem I am dealing with seems to be more general as it concerns some basic handling of the group permissions.

In other words, as a user vbox in a terminal I can access files created by others with permissions -rw-rw---- because vbox is a member of the corresponding group. This however does not work from the windows guest via SharedFolders. The VM runs as headless under user vbox. Once I change permissions to -rw-rw-r-- the file becomes readable from the windows guest.

Any help and hints will be greatly appreciated. I'm working with VirtualBox 4.3.2 r90405
--maksik
Martin
Volunteer
Posts: 2561
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Access group-rw directories via Shared Folders

Post by Martin »

Vbox shared folders don't include individual access control. The files on the host are accessed with the rights of the user running the Virtualbox on the host.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Access group-rw directories via Shared Folders

Post by mpack »

GA Shared Folders is not network access. VBox is an application running under your user account on your host, and it has the same access any other host application does. If you want to use true network shared folders then you need to configure those yourself.
maksik
Posts: 2
Joined: 31. Oct 2014, 15:04

Re: Access group-rw directories via Shared Folders

Post by maksik »

Hi Martin & mpack,

both of you are exactly right and what you describe is the behavbiour I was expecting. However the reality seems to be different.

Once, again, let's simplify the example. Imagine I have a user 'joe' saving his files under directory /shared. I also have an account 'vbox' which is used to run windows guest(s). The directory /shared is mapped to the windows guest via the SharedFolders feature. Both 'joe' and 'vbox' belong to the same group, say 'hardworkers'. The difrectory /shared is configured using g+s and ACLs to ensure that all the files created inherit rw permissions for the group and the group membership. This works perfectly in Samba and under Linux.

Now imagine we have a file

-rw-rw---- 1 joe hardworkers 2754 Oct 31 22:02 some_file.txt

I can read/write it perfectly as a local user 'vbox' because it belongs to the group 'hardworkers' but I cannot access it from the windows guest via the mapped shared folders. The very moment I open-up the access to all (chmod o+rw) the file starts to be accessible for reading and writing via shared folders.

Any ideas how to dig into this?

--maksik

P.S.: I've tested it on my laptop and could not reproduce the problem. It seems to be related either to the LDAP set-up on my server (more likely) or the fact that machines run as headless (less likely).
Post Reply