RSS



Ubuntu Quicktip – Converting Mac .dmg images into .iso images

Tue, Jan 23, 2007

Linux, Quicktips, Ubuntu

Talk about it in our Forums

I recently came across a handy script that allows you to convert a Mac OSX or Apple’s iPod (iPod firmware generated images) to standard .iso files.

You’ll need to have perl installed. Also, you may need to add an additional dependency in the form of a perl zlib module. So, here’s how to install it:

sudo apt-get install libcompress-zlib-perl

cd /usr/bin

sudo wget http://www.blinkenlights.ch/gnupod/dmg2iso.pl

Now, in my Ubuntu install I had to make one change to the dmg2iso.pl script.

sudo gedit dmg2iso.pl

At the very top you should see a line that says ‘#!/usr/local/bin/perl‘. This tells the script where to find perl. On my installation, perl is located in ‘/usr/bin/perl‘. So change that line if you need to.

Now let’s make it excecutable.

sudo chmod 777 dmg2iso.pl

Back to your home directory now.

cd

If you have a .dmg file in your home directory (or any directory) called bloodspell.dmg, and you want to convert it to a .iso file you can type:

dmg2iso.pl bloodspell.dmg bloodspell.iso

The script will take care of the rest.

Popularity: 16% [?]

Share and Enjoy:
  • Digg
  • del.icio.us
  • MisterWong
  • Reddit
  • Technorati
  • BlinkList
  • Facebook
  • Fark
  • Mixx
  • Slashdot

This post was written by:

arsgeek - who has written 1989 posts on ArsGeek.


Contact the author

40 Comments For This Post

  1. Elez J. Shenhar Says:

    ok, let me just go right ahead and ask…
    Why would you need to do something like turn a dmg to an iso?

  2. arsgeek Says:

    Good question. Here’s my answer – may be different for other folks.

    I work in an environment that has a bunch of Macs. A coworker of mine is constantly making images of various work related stuff on his Mac and then putting it out there for others to use.

    I’m on Linux/Windows. When I download his workstuff.dmg file I’ve got a 600MB file I can’t do much with.

    So I convert it to an ISO and either mount it directly or burn it to a CD/DVD.

  3. Elez J. Shenhar Says:

    oh… I thought .dmg is like a .deb or .rpm
    …doesn’t dmg stand for “disk image” or something?

  4. arsgeek Says:

    Something along those lines. :)

  5. Jess Says:

    hi i have troubles with this, i have those line at the end of my terminal look

    wiseo@wiseo-desktop:~/Escritorio$ dmg2iso.pl 1.dmg 1.iso
    dmg2iso v0.2a by vu1tur (vu1tur@gmx.de)

    PropertyList is corrupted

    whats wrong with this :S help

  6. Jamie Says:

    I am getting the same thing as Jess

  7. Martens Says:

    sudo: unable to execute /usr/bin/dmg2iso.pl: Access Deneid

    Help! It does not work properly
    I’m trying to turn this file http://support.aficio.com/bb/pub_e/dr_ut_e/0001061/0001061510/V120/I21649L9.dmg into a usable file for Ubuntu 8.04. I like to install a network printer, and it worked sofar, wright now it spits paper all over me. I used the PostScript driver from the WinXP intallation files.

    Can someone please help me?

  8. Maxxxx Says:

    bad interpreter: No such file or directory
    what i must do !!!

  9. n3p3nthess Says:

    Thank you, works fine

  10. LoneStar Says:

    WinXP/Ubuntu dual boot machine. Ubuntu is on the 5th partition.

    First off, just using the command dmg2iso.pl returns “Command not found”. I have to use ./dmg2iso.pl. Then I get …

    lonestar@LoneStar:~$ ./dmg2iso.pl Desktop/Mac\ OS\ X\ Install\ DVD.dmg Desktop/Mac_OSX_10-5-6_Install_DVD.iso
    dmg2iso v0.2a by vu1tur (vu1tur@gmx.de)

    reading property list…found 6 partitions
    decompressing:
    partition 0
    partition 1

    Conversion failed. File may be corrupted.

  11. jonbonjovi Says:

    Same answer from terminal like LoneStar!!

    dmg2iso v0.2a by vu1tur (vu1tur@gmx.de)

    reading property list…found 5 partitions
    decompressing:
    partition 0
    partition 1

    Conversion failed. File may be corrupted.

  12. derek Says:

    i have the problem of trying to make this work; it’s saved to usr/bin but my comp searches usr/local/bin

  13. MIlton Says:

    Great!

  14. Noel Says:

    I use 7zip for Windows because it can read and decompress dmg mac files. Give it a try, it’s free.

  15. Noel Says:

    For those people getting the “^M: bad interpreter: No such file or directory” error, try editing dmg2iso.pl with vi instead.

    I tried gedit to edit and save dmg2iso.pl and for some reason when viewing the file with vi, ^M appears at the end of every line. I removed these characters using vi editor and the perl script proceeded successfully.

  16. Hauke Says:

    Thanks a lot! I tried dmg2img before (which failed), but this solution finally works out just fine.

    Hauke

  17. Nice Says:

    Nice guide, but chmod +x, never use 777.

  18. Yosi Says:

    Thats what i get: bash: /usr/bin/dmg2iso.pl: /usr/local/perl15: bad interpreter: No such file or directory

    i supouse that means that perl is not there…now the question is how do i know where perl is???? thanks in advance

  19. h3retic Says:

    Awesome! Works like a charm!

  20. JeremyG Says:

    Worked perfectly, thanks very much for the clear and precise instructions, couldn’t be better!

  21. Azhar Says:

    I meaned “dmgextractor” not “hfsexplorer”
    sorry

  22. daakadence Says:

    yosi : try “which perl” to find out where perl is stored on your system

  23. Lash Says:

    Great, works a charm! well done there that man….

  24. DevelopX Says:

    Hay everyone! I did everything as sayd but here what I’v got

    root@developx:/media/98EAD0EAEAD0C5A2/Users/Dev/Desktop/mac# dmg2iso.pl Mac_OS_X_Install_DVD.dmg Mac_OS_X_Install_DVD.iso
    dmg2iso v0.2a by vu1tur (vu1tur@gmx.de)

    reading property list…found 6 partitions
    decompressing:
    partition 0
    partition 1
    partition 2
    partition 3
    partition 4
    partition 5
    Hexadecimal number > 0xffffffff non-portable at /usr/bin/dmg2iso.pl line 82.
    Out of memory!
    root@developx:/media/98EAD0EAEAD0C5A2/Users/Dev/Desktop/mac#

    Please help me. Thanks!

  25. David Marceau Says:

    Worked like a charm. God bless you.

  26. dante Says:

    Cool .. now I’m converting .dmg to .iso … Snow Leopard .. many thanks

  27. Eric Says:

    Acetoneiso will do this for you, if you prefer gui tools.

  28. german Says:

    AAAHHHH! Don’t EVER make things in /usr/bin chmod 777! It needs to be world executable, not world WRITABLE! You want chmod 755!

  29. Zip Says:

    Awesome guide, but chmod +x, never use 777.

  30. Sam Says:

    Hi everybody, if you’re encountering problems with the webpage loading, it might not just be your browser. Make sure you clear your cookies and try to reload the webpage. That might make it work better.

  31. lordlanguage Says:

    /usr/bin/dmg2iso.pl: 13: use: not found
    /usr/bin/dmg2iso.pl: 14: use: not found
    /usr/bin/dmg2iso.pl: 15: use: not found
    /usr/bin/dmg2iso.pl: 16: Syntax error: word unexpected (expecting “)”)

  32. Karima Lerma Says:

    Cool post it is actually. Friend on mine has been looking for this update

  33. Ryan Says:

    I got it all going. but then I get

    Syntax: dmg2iso.pl filename.dmg filename.iso

    that means it worked, right?
    but it didn’t

  34. coach purses on sale Says:

    buy a large sheet is tasted, can satisfy with possessive, aimed at vanity fair maiden dress up the necessary of the season.

  35. Lukekire Says:

    Thanks man for this script, made it so easy to convert them to iso, now i can burn these cds finally and they work perfectly on mac! Thanks again. I had to use it a little different though, i dragged and dropped the pl script file and the dmg image, then I made a new iso file in the home folder. I could see where most of these other people could go wrong, took some trial and error but this does work!

  36. Amar Says:

    This just works fine..

    root@amarendra-Ultra-24:~# dmg2iso.pl ~/Downloads/Mac\ OS\ X\ 10.6.4\ RETAILl\ .dmg apple_osx.iso



    Hexadecimal number > 0xffffffff non-portable at /usr/bin/dmg2iso.pl line 81.
    Integer overflow in hexadecimal number at /usr/bin/dmg2iso.pl line 81.
    Hexadecimal number > 0xffffffff non-portable at /usr/bin/dmg2iso.pl line 81.

    conversion successful

  37. mortgage calculator Says:

    And Field Championships in Eugene, Ore.

  38. karpath Says:

    works fine, you just saved my life.

  39. str8X Says:

    Man , you have no a idea how much you helped me ! thanks =)

  40. MiguelQuiros Says:

    Did not work for me. I’ve got:

    dmg2iso.pl iATKOS_L2.dmg iATKOS_L2.iso
    dmg2iso v0.2a by vu1tur (vu1tur@gmx.de)

    reading property list…found 4 partitions
    decompressing:
    partition 0
    partition 1
    partition 2
    partition 3
    Negative length at /usr/local/bin/dmg2iso.pl line 85.

4 Trackbacks For This Post

  1. Sprazzi di lucidità » Convertire DMG in ISO: MacOSX, Windows e Linux Says:

    [...] via macosxhints, vu1tur, arsgeek. [...]

  2. Mengubah *.dmg (Mac) ke *.iso di Linux « Hary Mulyadi Says:

    [...] Ref: http://www.arsgeek.com/2007/01/23/ubuntu-quicktip-converting-max-dmg-images-into-iso-images/ [...]

  3. [??] ????? dmg ??? iso ??? ???? Says:

    [...] ??? Ubuntu Quicktip – Converting Mac .dmg images into .iso images ?. 2007? 1? 23?? ??? ???. [...]

  4. how to convert dmg file to iso file on ubuntu 11.04 Says:

    [...] See here – http://www.arsgeek.com/2007/01/23/ub…to-iso-images/ Cheers, [...]

Leave a Reply