Can't mount raw disk VMDK

Discussions related to using VirtualBox on Windows hosts.
Post Reply
VirtualParadoxBox174
Posts: 3
Joined: 7. May 2021, 22:48

Can't mount raw disk VMDK

Post 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.
Attachments
Screenshot 2021-05-07 165942.png
Screenshot 2021-05-07 165942.png (15.56 KiB) Viewed 2488 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Can't mount raw disk VMDK

Post 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.
VirtualParadoxBox174
Posts: 3
Joined: 7. May 2021, 22:48

Re: Can't mount raw disk VMDK

Post 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"
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Can't mount raw disk VMDK

Post 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.
VirtualParadoxBox174
Posts: 3
Joined: 7. May 2021, 22:48

Re: Can't mount raw disk VMDK

Post by VirtualParadoxBox174 »

Well, there we go. Either the forward-slashes or the capitalization was the culprit. Thanks for the help!
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Can't mount raw disk VMDK

Post 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.
Post Reply