Page 1 of 1

.dmg files on Snow Leopard guest

Posted: 24. Sep 2011, 06:26
by benneese
I hope this question hasn't been asked already, but i certainly could not find it on the forum.
I am trying to mount a .dmg file for my Snow Leopard 10.6.2 guest, but virtual box keeps giving me this error:
Failed to open the CD/DVD image C:\Users\[...].dmg.

Could not open the medium 'C:\Users\[...].dmg'.

VD: error VERR_VD_DMG_INVALID_HEADER opening image file 'C:\Users\[...].dmg' (VERR_VD_DMG_INVALID_HEADER).

Result Code: E_FAIL (0x80004005)
Component: Medium
Interface: IMedium {53f9cc0c-e0fd-40a5-a404-a7a5272082cd}
Callee: IVirtualBox {c28be65f-1a8f-43b4-81f1-eb60cb516e66}

I was able to mount a previous .dmg file successfully in virtualbox and it ran well in the Mac guest.
Why doesn't this one work and how can i fix it?
Thanks in advance.

Re: .dmg files on Snow Leopard guest

Posted: 24. Sep 2011, 13:10
by Sasquatch
Mounting .dmg files is not a feature in VB. If you happen to have been able to mount them previously, then you were either lucky or it was actually another file.
If VB does support .dmg files (manual doesn't mention it), then the dmg file you got is dmged.

Re: .dmg files on Snow Leopard guest

Posted: 24. Sep 2011, 15:01
by benneese
so if i did just get lucky with my first .dmg that worked, what is the best way to go about converting a .dmg to .iso? Assuming the .dmg that i have isn't damaged...

Re: .dmg files on Snow Leopard guest

Posted: 24. Sep 2011, 15:02
by Sasquatch
Yes.

Re: .dmg files on Snow Leopard guest

Posted: 25. Sep 2011, 05:03
by benneese
So what is the best way to convert .dmg to .iso? do you have a preferred program?

Re: .dmg files on Snow Leopard guest

Posted: 25. Sep 2011, 12:46
by Sasquatch
I'm not a Mac user (I prefer to stay away from those things), so you have to ask Google that question. I'm sure it knows the answer.

Re: .dmg files on Snow Leopard guest

Posted: 20. Oct 2011, 18:11
by theDaniel
benneese wrote:So what is the best way to convert .dmg to .iso? do you have a preferred program?
You don't say if your host is Mac or otherwise. On a Mac you can just change the extension from .dmg to .iso. iso to dmg also works.

This has worked on all my Macs that I've had over the years. But, I have to say I don't have a Mac Guest to experiment with.

-Daniel

Re: .dmg files on Snow Leopard guest

Posted: 21. Oct 2011, 07:37
by Sharpie
benneese wrote:So what is the best way to convert .dmg to .iso? do you have a preferred program?


From the command line, you can use hdiutil:

Code: Select all

hdiutil convert /path/to/image.dmg -format UDTO -o /path/to/new_image.iso
DiskUtility in /Applications/Utilities can probably do the conversion as well if you prefer a GUI program.
theDaniel wrote:
benneese wrote:So what is the best way to convert .dmg to .iso? do you have a preferred program?
You don't say if your host is Mac or otherwise. On a Mac you can just change the extension from .dmg to .iso. iso to dmg also works.

This has worked on all my Macs that I've had over the years. But, I have to say I don't have a Mac Guest to experiment with.
Note that this is probably a false positive---changing a file extension does not magically transform the format of the data the file contains.

Re: .dmg files on Snow Leopard guest

Posted: 21. Oct 2011, 17:23
by theDaniel
Sharpie wrote:Note that this is probably a false positive---changing a file extension does not magically transform the format of the data the file contains.
I've cut my computing teeth on the Mac platform and this is common practice in the Mac community. Changing a file extension may not work with every file, but usually the Mac works in the background changing the type, unseen by humans. :)
You may be right, it may be that Apple in recent releases, trying to lure more Windows users, has changed the Mac's ability to do this.

Re: .dmg files on Snow Leopard guest

Posted: 5. Nov 2011, 07:46
by mino
I just figured this out for a read/write dmg. You can use Disk Utility or hdiutil to convert a dmg to a read/write image. Once you have a read/write image you can use VBoxManage to convert it to a vmdk. A read/write image creates a file the size of the disk the image was created from so you will need a volume 2x the size of the original disk.

In Terminal.app enter:

Code: Select all

VBoxManage convertfromraw sourcefilename.dmg destfilename.vmdk --format VMDK
The reason this works for a read/write image is that a read/write image is a raw block copy of the entire disk. I have only tried this for a full disk with a partition map. I don't know how it will work for a volume image.

When this worked for you it must have been a read/write image.

Re: .dmg files on Snow Leopard guest

Posted: 6. Nov 2011, 03:32
by theDaniel
Thanks Mino, This is great to know.
But, shocking :shock: that the developers would integrate such a useful feature, even if it is through the CLI!

Disk Utility.app makes several read/write disk images. The two I make use of every now and then are the one you mention, the read/write .dmg, and the CD/DVD Master. The latter has an extension of .cdr. A .cdr disk image can be used sometimes to trick the occasional application that requires a physical CD.