Shared folder permissions issue

Discussions related to using VirtualBox on Windows hosts.
Post Reply
lh0791
Posts: 3
Joined: 9. Aug 2018, 09:04

Shared folder permissions issue

Post by lh0791 »

I am running Linux Mint as a VM through virtual box via a Windows 10 host machine.

All is working well, but I am having trouble getting shared folder permissions to work properly. I have installed the guest add on onto the Ubuntu VM and setup a share in the VM config with "auto mount" and full access.

After giving my linux username membership to the vbox_sf group and restarting the VM, I can read all files on the host share, create new folders, delete/move existing files and write new files. At first glance this seemed fine. However, I am unable to modify any existing files that reside there. Linux always complains that the file is in use elsewhere. The same error occurs with various file types so it seems to be related to permissions some how.

Some forum posts online have suggested that VIrtualbox's auto mount privileges are restricted somehow, so I have attempted to mount the share manually via terminal to various locations. E.g

sudo mount -t vboxsf -o rw,uid=1000,gid=1000 myshare /media

sudo mount -t vboxsf -o rw,uid=1000,gid=1000 myshare ~/share

These commands map the share successfully, but I still have the same error when attempting to modify files that reside there.

How can I mount the share with full editor permission?

Thank you
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Shared folder permissions issue

Post by socratis »

lh0791 wrote:After giving my linux username membership to the vbox_sf group
There should be no such group. The group is 'vboxsf' without the underscore. Can you double check that it's not a typo?
lh0791 wrote: I have installed the guest add on onto the Ubuntu VM
I'd like to see evidence of that if you don't mind. Follow a "start the VM from cold-boot" / "observe error" / "shutdown the VM" cycle. With the VM completely shut down (not paused or saved), right-click on the VM in the VirtualBox Manager and select "Show Log". Save only the first "VBox.log", ZIP it and attach it to your response (see the "Upload attachment" tab below the reply form).
lh0791 wrote:I am unable to modify any existing files that reside there. Linux always complains that the file is in use elsewhere.
That may not be due to permissions, but due to file locking. VirtualBox's Shared Folders present a very simplified file system implementation, just enough to read/write files from/to the guest. Many applications can error when using Shared Folders, because they expect advanced features, for example file locking, access controls, etc., which don't exist as a concept for Shared Folders.
lh0791 wrote:I still have the same error when attempting to modify files that reside there.
Can you read/write files? As in copy files to/from guest from/to host? If yes, then the Shared Folders are working as expected. It's your expectations that are exceeding what Shared Folder can/can't do.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
lh0791
Posts: 3
Joined: 9. Aug 2018, 09:04

Re: Shared folder permissions issue

Post by lh0791 »

Thanks for responding Socratis.

You are correct - that was a typo, the group is "vboxsf" as it should be.

Guest additions are definitely installed, this was performed through the CD image - the VM now performs much quicker and no longer complains about lack of hardware acceleration. The shared points did not appear at all until this was installed.

To answer your question, yes - I am able to read and write files to the host share without issue.

e.g

I can create a file called hello.txt via the linux guest VM and place it on the share mount point, this then appears on the windows host NTFS system as-well as expected.

Via the linux guest VM, I can rename/move/delete this file as I wish - as with all other files residing in the share location. The problem occurs when I attempt to modify/edit the contents of any of these files.

In the case of saving changes hello.txt (via xed), the error is "Unexepcted error: Error renaming temporary file: Text file busy". I also receive errors when attempting to add files to a ZIP or edit a picture on the share - the permissions do not work as I would expect them too.

Before I troubleshoot any further I'd like to know if this a limitation of virtualbox itself - could someone kindly attempt to edit a text file on a shared folder as I have done so above and report their outcome?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Shared folder permissions issue

Post by socratis »

lh0791 wrote:could someone kindly attempt to edit a text file on a shared folder as I have done so above and report their outcome?
  • Host: OSX 10.11.6.
  • VirtualBox: 5.2.16 r123759 and 5.2.97 r124235.
  • Guest: Windows 10x64, 1607 (14393.1480)
Editing and saving a file on a Shared Folder with Notepad works. I suspect that the programs that you're using need advanced filesystem features like I've mentioned previously, and those do not exist in a Shared Folder. You could either change the programs that you're using, or switch completely from VirtualBox Shared Folders to true Network Shares (SMB, NFS, etc.).

As I've said; Shared Folders are a quick and dirty way to copy files between host and guest. Nothing more.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
lh0791
Posts: 3
Joined: 9. Aug 2018, 09:04

Re: Shared folder permissions issue

Post by lh0791 »

Thanks for checking - curious that the issue does not exist between OSX host and Windows 10 guest. I wonder if it's related to the way permissions are handled host side on an NTFS file system..

I'll investigate implementing an SMB based share as work around, but would prefer to avoid the network overhead. HGFS based shared folders work just fine via VMware Player so it's a shame VirtualBox is lacking in this regard. in every other respect, I prefer it.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Shared folder permissions issue

Post by socratis »

lh0791 wrote:curious that the issue does not exist between OSX host and Windows 10 guest.
No. I gave you an example application to try from a Windows guest. From a Mint guest, you could use gedit, I just tested it with Mint 17.3. Can you? Also, your thought about the NTFS permissions on your host might have something to do with it. But if you didn't have Write access you'd get a read-only warning, no? Check in any event to make sure.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply