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: 14% [?]












January 23rd, 2007 at 12:27 pm
ok, let me just go right ahead and ask…
Why would you need to do something like turn a dmg to an iso?
January 23rd, 2007 at 12:34 pm
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.
January 23rd, 2007 at 1:28 pm
oh… I thought .dmg is like a .deb or .rpm
…doesn’t dmg stand for “disk image” or something?
January 23rd, 2007 at 1:32 pm
Something along those lines.
November 29th, 2007 at 2:30 pm
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
January 6th, 2008 at 1:46 pm
I am getting the same thing as Jess
June 20th, 2008 at 6:40 am
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?
February 4th, 2009 at 11:24 am
bad interpreter: No such file or directory
what i must do !!!
March 13th, 2009 at 11:40 am
Thank you, works fine
May 6th, 2009 at 11:25 pm
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.
May 9th, 2009 at 8:30 pm
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.
May 28th, 2009 at 12:14 pm
i have the problem of trying to make this work; it’s saved to usr/bin but my comp searches usr/local/bin
May 31st, 2009 at 9:36 pm
Great!
August 5th, 2009 at 9:46 am
I use 7zip for Windows because it can read and decompress dmg mac files. Give it a try, it’s free.
August 5th, 2009 at 10:42 am
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.
September 17th, 2009 at 4:15 am
Thanks a lot! I tried dmg2img before (which failed), but this solution finally works out just fine.
Hauke
September 27th, 2009 at 12:17 pm
Nice guide, but chmod +x, never use 777.
October 3rd, 2009 at 5:57 pm
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
October 16th, 2009 at 10:41 am
Awesome! Works like a charm!
October 22nd, 2009 at 12:39 am
Worked perfectly, thanks very much for the clear and precise instructions, couldn’t be better!
October 28th, 2009 at 10:41 am
I meaned “dmgextractor” not “hfsexplorer”
sorry
November 1st, 2009 at 3:13 pm
yosi : try “which perl” to find out where perl is stored on your system
December 2nd, 2009 at 11:52 am
Great, works a charm! well done there that man….
December 22nd, 2009 at 1:33 pm
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!
March 26th, 2010 at 6:28 pm
Worked like a charm. God bless you.
April 13th, 2010 at 6:50 am
Cool .. now I’m converting .dmg to .iso … Snow Leopard .. many thanks
June 26th, 2010 at 3:52 am
Acetoneiso will do this for you, if you prefer gui tools.
July 29th, 2010 at 11:13 am
AAAHHHH! Don’t EVER make things in /usr/bin chmod 777! It needs to be world executable, not world WRITABLE! You want chmod 755!
August 18th, 2010 at 4:23 am
Awesome guide, but chmod +x, never use 777.