.dmg files on Snow Leopard guest

Discussions about using Mac OS X guests (on Apple hardware) in VirtualBox.
Post Reply
benneese
Posts: 3
Joined: 24. Sep 2011, 06:18
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Mac OSX

.dmg files on Snow Leopard guest

Post 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.
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: .dmg files on Snow Leopard guest

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
benneese
Posts: 3
Joined: 24. Sep 2011, 06:18
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Mac OSX

Re: .dmg files on Snow Leopard guest

Post 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...
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: .dmg files on Snow Leopard guest

Post by Sasquatch »

Yes.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
benneese
Posts: 3
Joined: 24. Sep 2011, 06:18
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Mac OSX

Re: .dmg files on Snow Leopard guest

Post by benneese »

So what is the best way to convert .dmg to .iso? do you have a preferred program?
Sasquatch
Volunteer
Posts: 17798
Joined: 17. Mar 2008, 13:41
Primary OS: Debian other
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, Linux
Location: /dev/random

Re: .dmg files on Snow Leopard guest

Post 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.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org

Retired from this Forum since OSSO introduction.
theDaniel
Posts: 39
Joined: 12. Oct 2011, 16:44
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Wind-does-blow XP (Xtra Porous), ReactOS
Location: Eastern Most County in USA

Re: .dmg files on Snow Leopard guest

Post 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
Sharpie
Posts: 20
Joined: 12. Apr 2010, 09:35
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: linux mint, win 7, OS X

Re: .dmg files on Snow Leopard guest

Post 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.
theDaniel
Posts: 39
Joined: 12. Oct 2011, 16:44
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Wind-does-blow XP (Xtra Porous), ReactOS
Location: Eastern Most County in USA

Re: .dmg files on Snow Leopard guest

Post 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.
mino
Posts: 2
Joined: 5. Nov 2011, 07:26
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Ubuntu, Mac OS X 10.7

Re: .dmg files on Snow Leopard guest

Post 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.
theDaniel
Posts: 39
Joined: 12. Oct 2011, 16:44
Primary OS: Mac OS X other
VBox Version: OSE other
Guest OSses: Wind-does-blow XP (Xtra Porous), ReactOS
Location: Eastern Most County in USA

Re: .dmg files on Snow Leopard guest

Post 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.
Post Reply