Unable to set owner/group file/directory ownership from within linux guest

Discussions about using Linux guests in VirtualBox.
Post Reply
wb0gaz
Posts: 31
Joined: 8. Oct 2008, 00:58

Unable to set owner/group file/directory ownership from within linux guest

Post by wb0gaz »

Understand this to be a frequent problem, but I'm still stumped/frustrated (after lots of hours searching and solutions that don't fix at all.)

Problem - ubuntu guest cannot change owner (from root) or guest (from root or vb_sf), and cannot change permissions (chown, chmod and chgrp all report no error messages but fail to take any desired effect.)

The issue relates to running a database server on the guest that requires that it's local file store folder have group/user ID matching the database server (NOT the logged-in user). I cannot change owner/group to either local user or - more necessary - user/group ID of the database server.

I've used usermod -a -G vboxusers (user name of the database server running on the guest), followed by reboot. No resolution to issue.

I have linux host (ubuntu 18.04 64-bit), linux guest (ubuntu 18.04 64-bit), with shared folder defined in the host, pointing to a filesystem on the host (which uses ext3 filesystem). The guest has guest additions installed and (otherwise) working normally.

The linux guest accesses the shared folder. I've tried two configurations with same unwanted result:

1. All files/folders are set as root group/user ownership and unable to change either to the group/user of the database service. Auto-mount box is NOT selected. /etc/fstab (guest) is set to mount (mount name, path to shared folder, type = "vboxsf", options = defaults.)

2. All files/folders are set as root group/user ownership and unable to change either to the group/user of the database service. Virtualbox settings: folder path/name are set. Auto-mount box IS selected. No entry in /etc/fstab. Mount point in the guest shows up as /media/sf_d2. All files/folders are set as root/vboxsf as group/user ownership.

The goal is to be able to arbitrarily set a user on the guest (not the logged-in user, but the user/group ID of the database service running on the guest).

Any help (that tells me what to do, on either the host or the client)

Thank you very much,

Dave
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: Unable to set owner/group file/directory ownership from within linux guest

Post by Martin »

Guest additions shared folders cannot be used for file acces by programs when specific access rights or advanced locking functionality is needed.
The shared folder function is designed for simple file copy. Advanced features are not implemented.
You need to use full network shares (nfs/smb)
wb0gaz
Posts: 31
Joined: 8. Oct 2008, 00:58

Re: Unable to set owner/group file/directory ownership from within linux guest

Post by wb0gaz »

Thanks much for the clarification
wesinator
Posts: 3
Joined: 17. Apr 2020, 17:47

Re: Unable to set owner/group file/directory ownership from within linux guest

Post by wesinator »

Did you add the user to the vboxsf group ?

https://stackoverflow.com/questions/267 ... ermissions

This solved a permission denied error for me trying to access shared folder when it was mounted as root

I needed to reboot guest for change to take effect. Now I can access the shared folder without root permissions.
Post Reply