1

I dd'ed an entire Linux hard-drive with several partitions to a single raw disk image. I've given up on loop-mounting the file on OS X, so I've installed Debian on a VirtualBox on my Macbook, hoping to mount the image there. However, I'm experiencing a problem in VirtualBox trying to add the disk image to any of the floppy, IDE, or SATA controllers before booting the machine. It gives me this:

Failed to open the floppy disk file 
/path/to/clone.img.

Could not get the storage format of the medium 
'/path/to/clone.img' 
(VERR_NOT_SUPPORTED).

My question is: why does VirtualBox care? On a real computer, I can insert a disk containing complete nonsense in a drive and it doesn't spit the disk out and yell at me; the firmware or operating system does that.

If I tell VirtualBox "this is an ISO", shouldn't it say "If you say so..." and feed the image file's raw information to the virtual machine, regardless of what's in the file?

Sorry if this is a noob question, I'm still new to VMs, and VirtualBox especially. Thanks in advance.

Edit:

I did figure out how to mount the drive, but I still want to know why VirtualBox cares whether the .img file is valid.

Edit 2:

I was able to add the file by renaming it to "clone.iso" and adding it as a CD/DVD to the IDE controller.

8
  • You probably need to tell it that this is a raw file, not one of the other image files that virtual box supports (these include compress disks, that v-box would need to interpret). Commented Oct 3, 2015 at 21:12
  • 1) If you have the solution, then you should give that "detail" to help potential answerers target their question. 2) The error message seems to indicate that you did not specify (it "could not get") the storage format of the medium. Try specifying (or converting) it - which is likely what you did.
    – Dirk
    Commented Oct 3, 2015 at 21:13
  • @richard: I'll add for clarification. I figured that it would be implicit that it was a raw because I used dd to copy an entire hard drive. Commented Oct 3, 2015 at 21:21
  • @richard, actually it already does say 'raw disk image' in the first sentence. I know people tend to gloss over the first paragraph though. Commented Oct 3, 2015 at 21:22
  • @Dirk: Good suggestion. I added my fix; however, the question still stands. Commented Oct 3, 2015 at 21:25

1 Answer 1

2

VirtualBox does not support raw disk images. However, you can use the convertfromraw operation to convert the image:

VBoxManage convertfromraw   <filename> <outputfile>
                            [--format VDI|VMDK|VHD]
                            [--variant Standard,Fixed,Split2G,Stream,ESX]
                            [--uuid <uuid>]

Meaning, for example:

VBoxManage convertfromraw my_image.img my_image.vdi

Please note that you need enough disk space for both the raw and the VDI image.

2
  • It does say in that link you posted that the virtual media manager supports "floppy images in RAW format"... which is precisely what I was trying to do. Any clue why it would try to verify a raw file? Does it need meta-information? Commented Oct 3, 2015 at 23:10
  • No, it's not. It's not a floppy image and it's not a CD image either.
    – Daniel B
    Commented Oct 4, 2015 at 0:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .