Trying to attach an IMG file

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Melab
Posts: 19
Joined: 1. Jul 2009, 05:37
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows Vista Home Premium

Trying to attach an IMG file

Post by Melab »

I'm running VirtualBox 4.2.6 with the Extensions installed on a Windows 7 laptop. I'm trying to attach an IMG file that is 1 gigabyte in large with a block size of 4096 to my virtual machine, but all I get is:

Code: Select all

Failed to open the floppy image <path redacted by me>.

Could not get the storage format of the medium '<path redacted by me>' (VERR_NOT_SUPPORTED).

Result Code: VBOX_E_IPRT_ERROR (0x80BB0005)
Component: Medium
Interface: IMedium {29989373-b111-4654-8493-2e1176cba890}
Callee: IVirtualBox {3b2f08eb-b810-4715-bee0-bb06b9880ad2}
Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)
What gives?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Trying to attach an IMG file

Post by Perryg »

I don't think that a floppy controller can handle that size.
What is the image? Is it from dd?
Melab
Posts: 19
Joined: 1. Jul 2009, 05:37
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows Vista Home Premium

Re: Trying to attach an IMG file

Post by Melab »

I created the image using:

Code: Select all

dd if=/dev/zero of=DUET.img bs=4096 count=262144
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: Trying to attach an IMG file

Post by mpack »

In that case the blocksize info given in the first post was meaningless. You created a binary file of size 4Kx256MB == 1GB filled with zeros. It has no internal structure. At one gig it's way too large to be a floppy, you could however create a VMDK text descriptor for it and mount it as a hard disk... though I'm wondering why you wouldn't just use "VBoxManage createhd" to do the whole thing in one step.
Melab
Posts: 19
Joined: 1. Jul 2009, 05:37
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows Vista Home Premium

Re: Trying to attach an IMG file

Post by Melab »

It's my experience that USB images are usually stored as IMG files and I used an IMG to install Android before, so I figured that an IMG file would be the best way to approximate a real USB since I can't seem to get the guest to recognize it [my USB drive].
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: Trying to attach an IMG file

Post by mpack »

A flash drive image is basically the same as a hard disk image. The file extension is not important, the internal structure is. As I mentioned earlier, if your goal is to manipulate a fixed size image then the best way IMHO is via a VMDK descriptor as discussed e.g. in this thread.
Post Reply