vmdk created wit VBoxManage doesn't work.

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
f0rd42
Posts: 2
Joined: 11. May 2015, 09:43

vmdk created wit VBoxManage doesn't work.

Post by f0rd42 »

Hi

I need to install a piece of software (VyOS 7 Vyatta) on a compact flash.
I found several guides on the net which used Virtualbox.

Running Mac OS X 10.10, VirtualBox 4.3.26

I have a 4GB Compactflash Card and used:

VBoxManage internalcommands createrawvmdk -filename rawdisk.vmdk -rawdisk /dev/disk2

this creates a rawdisk.vmdk file and (remounts) the /dev/disk2)

But when I try to use this rawdisk.vmdk as an existing disk, I get:

Failed to open the hard disk file /Users/adieball/Desktop/rawdisk.vmdk.

Permission problem accessing the file for the medium '/Users/adieball/Desktop/rawdisk.vmdk' (VERR_ACCESS_DENIED).

Result Code: VBOX_E_FILE_ERROR (0x80BB0004)
Component: Medium
Interface: IMedium {05f2bbb6-a3a6-4fb9-9b49-6d0dda7142ac}
Callee: IVirtualBox {fafa4e17-1ee2-4905-a10e-fe7c18bf5554}
Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)

Can anyone help me getting this fixed?

thanks

Andre

PS: I'll boot from an ISO file, install on the CF within virtualbox and the stick that CF into a ALIX / PCEngines board.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: vmdk created wit VBoxManage doesn't work.

Post by mpack »

f0rd42 wrote: VBoxManage internalcommands createrawvmdk -filename rawdisk.vmdk -rawdisk /dev/disk2

this creates a rawdisk.vmdk file and (remounts) the /dev/disk2)
Actually, no it doesn't. It doesn't remount anything. All VBox does it create a VMDK descriptor for the selected drive or partition(s). VBox makes no attempt to access the drive, and any subsequent attempt you make will only work if the volume is offlined from the host first (at least that's what you do on other OS - I'm not an OS X expert).
f0rd42
Posts: 2
Joined: 11. May 2015, 09:43

Re: vmdk created wit VBoxManage doesn't work.

Post by f0rd42 »

Hi Something "remounts" the disk after creating the vmdk.

Anyway, If I triy to choose the vmdk with an unmounted CF card, I get a "not found" error.

Andre
blacflame
Posts: 1
Joined: 28. Dec 2015, 20:01

Re: vmdk created wit VBoxManage doesn't work.

Post by blacflame »

Late reply - but for future reference.

OS X does remount devices regularly via disk arbitration framework I believe. However depending on your OS X version, you may just need to change perms on the device itself.

sudo chmod 770 /dev/$device
sudo chown $user /dev/$device

OS X 10.10 and prior you could probably stop the service if needed -

sudo launchctl stop com.apple.diskarbitrationd

The preferred method (to my understanding) is - apple.stackexchange Dot COM/questions/200786/how-can-i-prevent-an-exfat-volume-from-mounting-on-os-x

On El Capitan (10.11) there's some additional issues with this that may/may not be related to SIP - inquired to the developer forums today - forums.developer.apple Dot COM/message/97972
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: vmdk created wit VBoxManage doesn't work.

Post by mpack »

I'm not sure all those links are relevant. The problem when using a VMDK raw disk descriptor is that do you want the host to mount the drive (because the host OS does the low level sector access), but offline the partitions on it, so that filesystem management is the VMs reponsibility, and won't conflict with the host.

OTOH, if you were wanting to assign a USB drive to the guest then you'd want to offline the drive itself: which is what I believe at least one of your links is about.

This is dangerous stuff. It is important to have a very clear understanding about the distinction between drive and filesystem, and who should have access to what. The penalty for getting it wrong is a corrupted host.
Post Reply