Erratic behaviour on raw disk permissions

Discussions related to using VirtualBox on Linux hosts.
Post Reply
pabzum
Posts: 9
Joined: 8. Aug 2015, 02:34

Erratic behaviour on raw disk permissions

Post by pabzum »

One of my storage devices is a vhd file pointing to a disk partition as a raw disk.
Sometimes, when opening the VM, I get the “VERR ACCESS DENIED” error message saying there are no permissions to access that vhd.
Whenever that happens, I always close all programs on Ubuntu and reboot. Then I can open the VM smoothly, with no error message, and it works quite well, with full access to the raw disk.
Please note that’s all I do: there’s not tweaking with permissions or anything. As far as I can tell, all permissions and group settings are ok. Otherwise, why would it work most of the time?
Of course, I’d rather not have that problem any more.
Can anyone tell me what could be causing this erratic behaviour?
Thanks!
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: Erratic behaviour on raw disk permissions

Post by socratis »

pabzum wrote:Can anyone tell me what could be causing this erratic behaviour?
I suspect your host OS. Or a process in there that has access to the VHD. VirtualBox needs exclusive access, and when you can't get it, you get that error. That's why a host reboot helps, because if you do this early on, VirtualBox is the first in line to get exclusive access to that VHD.
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.
pabzum
Posts: 9
Joined: 8. Aug 2015, 02:34

Re: Erratic behaviour on raw disk permissions

Post by pabzum »

The partition linked to the vhd in question is /dev/sdb3. Could the reason for the problem be that sometimes I also mount that partition on the Ubuntu host itself?
Does Ubuntu do something to it that VirtualBox subsequently doesn’t know of or doesn’t accept?
By the way:
• I never mount the /dev/sdb3 on the host or change anything in it while the guest is on;
• Actually, I never do anything to it anyway from the host, except sometimes copy a file *from* it into Ubuntu.

But I do use another partition on the same disk (/dev/sdb2) exclusively with another virtual machine, this one based on kvm-qemu and VirtManager (never at the same time with VirtualBox). This one is never bothered by anything I might do at any time with VirtualBox, though. Which makes me wonder that something in my VirtualBox settings is to blame, not in the host. Does this make sense?
Last edited by socratis on 7. Dec 2018, 21:40, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
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: Erratic behaviour on raw disk permissions

Post by socratis »

pabzum wrote:Could the reason for the problem be that sometimes I also mount that partition on the Ubuntu host itself?
Could be. I know that on my OSX host I have to eject the drive in order to be able to use it, even if it's a USB one, and in Windows you got to take the drive off-line, from the disk management. I expect similar behavior in Linux. And again, it's not a "permissions" error, it's an access denied error, because you don't have exclusive access to the disk.
pabzum wrote:wonder that something in my VirtualBox settings is to blame, not in the host. Does this make sense?
No, not really. See the explanation above.
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