Page 1 of 1

Problems with attaching raw host hard disk

Posted: 19. Aug 2011, 17:46
by alexy
Hello,

I'm under mac os 10.6.8 and virtualbox 4.1.2 for OS X hosts
I was trying to create several .vdmk files pointing at partion and disk, after that attach it to virtual machine.
(Idea is to install ubuntu as guest and then try to boot it without virtualbox).

Everything ok with creation .vdmk file for partition or for disk. But i can't attach it to new virtual machine with the following error in terminal:

Code: Select all

$ VBoxManage storageattach Ubuntu-blank-vm --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium /Users/alexey/VirtualBox/Ubuntu-2-disk/Ubuntu-2-disk.vmdk 
VBoxManage: error: The medium '/Users/alexey/VirtualBox/Ubuntu-2-disk/Ubuntu-2-disk.vmdk' can't be used as the requested device type
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component Medium, interface IMedium, callee nsISupports
Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, AccessMode_ReadWrite, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 210 of file VBoxManageDisk.cpp
VBoxManage: error: Invalid UUID or filename "/Users/alexey/VirtualBox/Ubuntu-2-disk/Ubuntu-2-disk.vmdk"

If im trying from GUI i'm getting error too:
Failed to open the hard disk /Users/alexey/VirtualBox/Ubuntu-2-disk/Ubuntu-2-disk.vmdk.

The medium '/Users/alexey/VirtualBox/Ubuntu-2-disk/Ubuntu-2-disk.vmdk' can't be used as the requested device type.

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: Medium
Interface: IMedium {53f9cc0c-e0fd-40a5-a404-a7a5272082cd}
Callee: IVirtualBox {c28be65f-1a8f-43b4-81f1-eb60cb516e66}
Any ideas what can be wrong?

Thanks in advance
Alexy

Re: Problems with attaching raw host hard disk

Posted: 4. Sep 2011, 14:00
by uniquepito
I've experienced the same problem but with the Parallels VM. So maybe it will be helpful for you too:
I've got the same error when I was trying to connect my old parallels virtual drive. Then I findout that my *.hdd file in my parallels VM is not a file, but a folder which contained *.hds file. This *.hds file I had to copy out rename to *.hdd file and attach to VirtualBox machine. Then everything worked like a charm.
I suppose in your case would be *.vmdk folder, just right clik on it ant try if is "Show package content" menu item available... Else, I don't know :(

Re: Problems with attaching raw host hard disk

Posted: 9. Sep 2011, 06:21
by terminus
Are you root? You need to be root. This is because otherwise you don't have permission to read and write to the partition as an ordinary user. I'm not sure how you would give yourself permission to do so, because otherwise this raw disk feature is a bit useless on Mac OS X. Hopefully someone else can advise?

Re: Problems with attaching raw host hard disk

Posted: 16. Sep 2011, 08:00
by rraicu
terminus wrote:Are you root? You need to be root. This is because otherwise you don't have permission to read and write to the partition as an ordinary user. I'm not sure how you would give yourself permission to do so, because otherwise this raw disk feature is a bit useless on Mac OS X. Hopefully someone else can advise?
terminus, thanks for noting this; it may seem obvious but starting VirtualBox from a default icon isn't with administrative privileges. As soon as I started virtualbox from an admin cmd.exe then I had no problems adding a raw disk .vmdk to my FreeNAS controller. Thanks again.