Page 1 of 1

Can't mount raw disk VMDK

Posted: 7. May 2021, 23:02
by VirtualParadoxBox174
I've been trying to mount my USB drive as a VMDK in VirtualBox so that I can install Debian to it, but for some reason it can't find it.

This is the message the GUI gives:

Code: Select all

Failed to open the disk image file C:\Users\[username]\VirtualBox VMs\Debian Portable Installation\Debian Portable Installation.vmdk.

Could not find file for the medium 'C:\Users\[username]\VirtualBox VMs\Debian Portable Installation\Debian Portable Installation.vmdk' (VERR_FILE_NOT_FOUND).

Result Code: VBOX_E_FILE_ERROR (0x80BB0004)
Component: MediumWrap
Interface: IMedium {ad47ad09-787b-44ab-b343-a082a3f2dfb1}
Callee: IVirtualBox {d0a0163f-e254-4e5b-a1f2-011cf991c38d}
Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)
I also tried it with VBoxManage, also to no avail:

Code: Select all

VBoxManage.exe: error: Could not find file for the medium 'C:\Users\[username]\VirtualBox VMs\Debian Portable Installation\Debian Portable Installation.vmdk' (VERR_FILE_NOT_FOUND)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee IUnknown
VBoxManage.exe: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 191 of file VBoxManageDisk.cpp
VBoxManage.exe: error: Invalid UUID or filename "C:\Users\[username]\VirtualBox VMs\Debian Portable Installation\Debian Portable Installation.vmdk"
I've attached a screenshot just to show that it is there. Any help would be greatly appreciated.

Re: Can't mount raw disk VMDK

Posted: 8. May 2021, 00:04
by scottgus1
You're trying raw disk access on a Windows host. Every Virtualbox process, main Virtualbox window or vboxmanage, must be Run As Administrator.

Did the USB device move? Maybe that's the file that is not found, not the .vmdk file.

You unnecessarily obfuscated your user name (consider: even if your user name was known, where in the over 4 billion IPv4 IP addresses is your PC so a hacker could try it? They'd need you password too, and you're already being pen-tested by botnets; about the only reason to hide a username is if it admits to having committed a crime :shock: ) so I must assume the username in the commands is the same as the username in the screenshot. If it is not, you need permissions to cross to another user's files.

Re: Can't mount raw disk VMDK

Posted: 8. May 2021, 18:31
by VirtualParadoxBox174
I've made sure both VBoxManage and VirtualBox were running as administrators, and verified the location of my USB drive, and it still throws up the same error. They are in the same user folder, by the way; I'll remember that last paragraph, lol.

EDIT: Here's the commands I used with VBoxManage to create and add the VMDK, by the way. Unobfuscated, just in case.

Create:

Code: Select all

VBoxManage internalcommands createrawvmdk -filename "C:\Users\nicho\VirtualBox VMs\Debian Portable Installation\Debian Portable Installation.vmdk" -rawdisk //./PHYSICALDRIVE2
Add:

Code: Select all

VBoxManage modifyvm "Debian Portable Installation" --hda "C:\Users\nicho\VirtualBox VMs\Debian Portable Installation\Debian Portable Installation.vmdk"

Re: Can't mount raw disk VMDK

Posted: 9. May 2021, 14:55
by scottgus1
I don't know if either of these matters, but the forward slashes in "//./PHYSICALDRIVE2" should be backslashes, and the example in the manual, section 9, shows CapitalizedCasing, not UPPERCASE, as in:

\\.\PhysicalDrive2

Also, check that your USB drive is still disk #2.

The manual does not seem to list '--hda' as a valid argument for 'vboxmanage modifyvm'. If you're trying to add the .vmdk to the VM, try using the main Virtualbox window.

Re: Can't mount raw disk VMDK

Posted: 9. May 2021, 18:29
by VirtualParadoxBox174
Well, there we go. Either the forward-slashes or the capitalization was the culprit. Thanks for the help!

Re: Can't mount raw disk VMDK

Posted: 10. May 2021, 10:04
by mpack
I'm pretty sure it's the slashes. Forward slashes have no meaning in a Windows path. I would also have wrapped the drive name "in quotes" just to be sure the command line processor didn't take a liking to any "option switches" it thought it saw.