VirtualBox

Opened 15 years ago

Closed 8 years ago

#2669 closed defect (obsolete)

Error -250 : VERR_DEV_IO_ERROR with rawdisk vmdk on MacOSX

Reported by: vienin Owned by:
Component: virtual disk Version: VirtualBox 2.0.6
Keywords: usb raw disk macosx Cc:
Guest type: Linux Host type: Mac OS X

Description (last modified by aeichner)

I'm trying to use an USB key as a vmdk raw disk on an MacOSX host.

By umounting all mounted partitions of the raw disk device, I'm able to create a raw disk vmdk file properly, but when I try to launch the corresponding VM, VirtualBox raise "-250 : VERR_DEV_IO_ERROR". Partitions of the raw disk are unmounted and not currently in use, but at each time VirtualBox access to device, partitions are automatically mounted by MacOSX, and "-250" error is raised.

So the only solution I have found is to have no partitions recognized by MacOSX on the USB key raw disk (like Ext3), but is really a problem for me.

Change History (8)

comment:1 by Frank Mehnert, 15 years ago

priority: blockermajor

comment:2 by drew, 15 years ago

I've bumped into this issue too. This might not be the place, but does anyone know of any other work arounds? For example, how to temporarily disable the OSX automounter?

in reply to:  2 comment:3 by drew, 15 years ago

A workaround using /etc/fstab to avoid the automountd problem:

in the terminal type this sudo pico /etc/fstab (or use whatever text editor you prefer)

add this line

LABEL=Windows XP none ntfs ro,noauto 0 0

"Windows XP" should be whatever your partition label is.

This was found at: http://forums.macosxhints.com/archive/index.php/t-67126.html

comment:4 by James Shewey, 15 years ago

Try virtualbox as root. Also, be sure to review the vmdk in a text editor such as vim. While windows and linux map to /dev/sda or \.\PhysicalDrive0, OS X partitions need to be mapped to /dev/disk0sX where X is the partiton number. So if you had to partitions, you may need the drives to map to /dev/disk0s3 and /dev/disk0s4. You can use an apple script to automatically escalate a program to root. The command should be something like:

do shell script "/path/to/virtualbox" with administrator privileges password "password"

comment:5 by vienin, 15 years ago

Thanks for your answers !

The problem come from MacOsX automouter daemon (DiskArbitrationd) indeed. So I'm using the fstab workaround by adding my volume as "noauto,ro", and this is a good solution for my problem.

But I'm interested to discuss about why VirtualBox is able to start a vm or create a raw vmdk with a mounted raw disk on Windows and Linux, whereas it is unable to do this on MacOsX. (Sure it is very dangerous to do this but it is just a technical curiosity.)

comment:6 by Lars Rasmusson, 15 years ago

Reading a little more of the comments on http://forums.macosxhints.com/archive/index.php/t-67126.html gave another option.

Since the problem is that the USB stick is mounted, we must prevent that. One way is to make the automounter fail its mount attempt by preventing in to create the mount point in /Volumes . This can be done by temporarily setting the uchg flag (set the user immutable flag). So this is what I did:

sudo  chflags uchg /Volumes

Now put in the USB stick. It won't mount, but its device node will be created, in my case /dev/disk1s1. Now its time to create the vmdk file:

sudo VBoxManage internalcommands createrawvmdk -filename usbraw.vmdk -rawdisk /dev/disk1s1

Now we can change back the flag that prevents the OS X automounter from mounting. This will not trigger a mounting attempt.

sudo  chflags nouchg /Volumes

Since the vmdk file is owned by root, I had to change the file owner to me, or else I wasn't allowed to read it. $LOGNAME is your usual login name

sudo chowner $LOGNAME:$LOGNAME usbraw.vmdk

Then the ususal: VirtualBox > File > Virtual Media Manager, click Add, navigate to the usbraw.vmdk and click on open to import it. Click OK to close Virtual Media Manager.

Now I can configure my virtual machine to use usbraw.vmdk as its Primary Hard Disk.

Please note:

I haven't tried this on a properly formatted USB stick though. Trying to boot from a USB stick that was set up for booting from a USB device gave me 'Boot error'. I guess I would have to reformat the USB drive for this to work. So this is not a fully correct solution for making a VirtualBox boot from a regular USB boot stick...

comment:7 by Frank Mehnert, 15 years ago

Component: othervirtual disk

comment:8 by aeichner, 8 years ago

Description: modified (diff)
Resolution: obsolete
Status: newclosed

Please reopen if still relevant with a recent VirtualBox release.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use