rawdisk partition access

Discussions related to using VirtualBox on Linux hosts.
Post Reply
jam78zen
Posts: 8
Joined: 6. Apr 2018, 20:50

rawdisk partition access

Post by jam78zen »

Following the instructions in 9.9.1.2 of the manual, I have tried to set up direct access to three of my partitions on /dev/sdc

I can create a file "sdc.vmdk":
sudo vboxmanage internalcommands createrawvmdk -filename /VM/VMnuffin/sdc.vmdk -rawdisk /dev/sdc -partitions 6,12,13

But when I attempt to attach the vmdk file I get errors:
sudo vboxmanage storageattach VMnuffin --storagectl SATA --port 1 --type hdd --medium /VM/VMnuffin/sdc.vmdk --setuuid ""

Like this:
VBoxManage: error: Permission problem accessing the file for the medium '/VM/VMnuffin/sdc.vmdk' (VERR_ACCESS_DENIED)
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 179 of file VBoxManageDisk.cpp
VBoxManage: error: Invalid UUID or filename "/VM/VMnuffin/sdc.vmdk"

Anybody help me see what I'm doing wrong? Or what devil has taken possession of my host OS [Mint 18.3]?
The man with only 1 arm
Posts: 5
Joined: 3. Jul 2018, 08:57

Re: rawdisk partition access

Post by The man with only 1 arm »

This might be helpful!

Sorry, just joined and unable to post URLs. Go to askubuntu and search for "Error mounting VirtualBox shared folders in an Ubuntu guest"
jam78zen
Posts: 8
Joined: 6. Apr 2018, 20:50

Re: rawdisk partition access

Post by jam78zen »

Heh. Sorry, that's not the issue. I've already encountered all (I hope) of the errors that can arise from shared folders. And solved them.

This thread has to do with direct access to host partitions, as described in section 9.9.1.2 of the big HELP manual.
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: rawdisk partition access

Post by Martin »

Never use 'sudo' to modify / configure / run a VM.
The VM belongs to the user, not to root.
(The 'createrawvmdk' commands are a special exception)

You need to make sure that your user account has the necessary access rights for all parts needed for the raw disk access: The vmdk file, the partition device(s), the disk device and in many cases you need a overlay file for the disk mbr.
If one of these parts is 'in use' by the host you also will get an 'access denied' error.
jam78zen
Posts: 8
Joined: 6. Apr 2018, 20:50

Re: rawdisk partition access

Post by jam78zen »

Ah thanks. That answer "feels right" even though I haven't confirmed it yet. I'll do that in the next couple of days.

Sudo got in there because (of course) my host was telling me I didn't have the permissions I evidently needed. So I did the "obvious" thing.
Post Reply