Filed under: Mac 101
Mac 101: DMG files are Disk Images
If you've ever downloaded a DMG file from a website, you've dealt with a disk image. Disk images are a kind of virtual disk--like a CD or DVD or even a hard drive. They store files in a way that acts like one of these data storage devices. To open a disk image, you just double click on it. The image mounts as a new volume on your desk top. This usually looks like a white hard drive. You can then double click this virtual drive itself to open its contents in a new Finder window. Copy items from the disk image by dragging them to your desktop or to your folders.
When you're done using the disk image, you can eject it. Either drag it to your trash can or Control-click (right-click) the volume and choose Eject from the contextual pop-up menu. When you reboot your computer, the disk image automatically unmounts. So if you wonder "where did that folder with my Application disappear to?" it may be that the disk image unmounted.
That brings me to the most important thing about disk images. You're not meant to run applications from them. When you download software that uses disk images, the idea is that you'll mount the image, copy the application to your hard drive (typically to the /Applications folder) and then dismount and discard the disk image. This is why so many disk images include an alias to your Applications folder. They're trying to make it easy for you to install the software. Just drag the new program onto the Applications folder--either the real one on your hard drive or the virtual one on the disk image. This copies the software into the right place and you're good to go. Eject the disk image and launch the copy in your /Applications folder.


![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 1)
Jon Stieglitz said 3:19PM on 5-02-2007
you can also eject them by pressing command + E
Reply
kubi said 3:24PM on 5-02-2007
What's the point of disk images? I've never understood why you can't just download the application itself.
Reply
Ahmad said 3:33PM on 5-02-2007
very useful tip for a new switcher who has no idea what those little white things are. It took me a few days to actually figure out that I needed to drag the app off the image to actually install it.
Reply
dwakefield said 3:47PM on 5-02-2007
kubi -
You can't just download the application, since an application isn't simply a single file. It's actually a directory containing a whole host of extra files. OSX treats it as an application, but other operating systems (and even the non-gui stuff in OSX) treats it as a directory. If you're bored some time, right-click (control-click...) an application and choose "Show Package Contents" to see the underlying directory structure - this can be quite interesting sometimes.
Reply
Dov said 3:50PM on 5-02-2007
But also, a DMG compresses the image, correct? So especially for a larger application (like an OS update) a DMG will be quicker to download, or at least such is my understanding.
Reply
cuvtixo said 3:56PM on 5-02-2007
You could have started this article with the UNIX paradigm that "Everything is a file" That is, unix treats files, physical disks, virtual disks, serial ports and items like printers as collections of bytes. Disk Images as used for distribution because boot information and files locked by the operating system (such as boot information or backup files in use) may not be saved. A full disk image contains all these, faithfully replicating all data.
Reply
Ahmad said 4:08PM on 5-02-2007
cuvtixo, this is Mac 101.
Reply
joe said 5:21PM on 5-02-2007
Noooooo....really???? are you for serious?
Reply
Julen said 5:23PM on 5-02-2007
Why you can't execute the App from de Image? I use this "trick" to test if the app is worth to copy. Does this damage anything? Thanks.
Reply
Ben said 5:29PM on 5-02-2007
Here's a nice little trick on OSX using dmgs. Take a CD, and use Disk Utility to make a dmg of it. Then, you can mount the dmg and trick the computer into thinking that the CD is inserted.
For example, the CD drive of my desktop broke, so I used another computer to make dmgs of all my game CDs. Now, I can still play them.
Reply
Flynn said 9:09PM on 5-02-2007
As a self-taught Mac user who is still learning some of the "basics,", I really appreciate when sites like this don't assume everyone reading is a Mac wiz. If it's too elementary for you, keep scrolling, but people like me turn to sites like this to learn.
Reply
kubi said 9:11AM on 5-03-2007
dwakefield -
Thanks for the reply, the application package system on OS X is so transparent that I forget that things aren't as simple as they look.
Julen -
It doesn't hurt a thing to run apps from the disk image, I do it all the time. The problem is that when you restart the image is unmounted. This used to drive me nuts when I first started using macs, before I understood what disk images were.
Reply
deeps said 4:27AM on 5-03-2007
As a recent switcher I appreciate the native capability to run disk images. With a PC you hace to install extra software to mount disk images :(
Can anyone tell me the best way to create disk images (I know about the mac disk utility) that have the alias and icon.
Reply
luciano said 4:34AM on 5-03-2007
Hi guys...thanks for a visit to my Blog!
http://www.lucianobove.blogspot.com
Reply
Michael said 5:03AM on 5-03-2007
I think what was thought of as the main advantage of disk images was that they could be "internet enabled".
Otherwise, one might as well tar and bzip (or gzip) an application bundle to distribute it.
Internet-enabling it means, to quote Apple, that:
"The browser launches Disk Copy with the .dmg file. The user watches a progress bar while Disk Copy mounts the disk image, copies the contents out of the image, unmounts the image, and moves the .dmg file to the Trash."
However, that advantage is lost, if you uncheck the "Open Safe files after downloading" in Safari's Preferences - as you probably should, since it has been used as an attack vector before now.
It's interesting to note that Apple now has a "Legacy Document" notice on the page I quoted from:
http://developer.apple.com/documentation/DeveloperTools/Conceptual/SoftwareDistribution4/Concepts/sd_disk_images.html
Panic, who always used to distribute software in this way, just put out their new application Coda in a zip (a Windows-type zip file, rather bzip or gzip). I'd guess they are preparing for 10.5.
In general, all the indications are that Apple is deprecating this method of software distribution and will be making new arrangements for 10.5.
Reply
dr.amazing said 10:25AM on 5-03-2007
Gosh, I thought the topic of this article couldn't be more obvious and that most of Erica's posts were just annoying filler, but I forgot that there are people who recently adopted the OS X platform who don't know this stuff (no offense meant)! Go Mac 101? :\
Reply
Mr Lizard said 6:39PM on 5-03-2007
The first app I ever downloaded when I switched from PC to Mac in 2004 was Firefox
It downloaded as a .dmg file, which, coming from the windows world of '.exe's, I assumed was some sort of mac executable.
Imagine my confusion when I clicked it and another icon appeared, this time looking like a disk drive.
Then imagine my confusion when I clicked on that, and a new window opened, with a firefox icon.
Then imagine my confusion when I learned that, in order to install it, I had to drag it to the applications folder.
But the finder window that was displaying the contents of the disk image did not have a side bar. So I clicked the Finder icon... nothing happened of course. Finder was already running.
So then I figured I had to click on File > New Finder Window just to see my applications folder.
All this, just to install an app.
Since I got a Mac, three of my friends have also got them. And the one thing that confuses them more than anything else (and there isn't much else), is disk images.
It's not obvious what to do with them. When there's an alias, then that makes things a lot better. But it's not always the case.
Sure, you can lay the blame at the door of the developer, for not including an alias. But for many, especially switchers, it seems a cumbersome way to install an app.
An icon, which when clicked opens another icon, which you then have to drag another icon out of, is not as simple as it sounds for a newbie.
By comparison, .exe files on windows are easy. Just double click it, and the installer starts.
Personally, I prefer .zip files. The fact that the zip file icon looks like a box suggests there's something inside, to unpack.
When you double click it, the contents are shown in a folder. The folder is familiar; it's obvious that the application is inside.
Installers are even easier. No need to drag anything anywhere.
There's my thoughts, anyway.... ;-)
Reply
poetphilosopher said 7:43PM on 5-03-2007
Actually, disk images are useful for keeping infrequently-used applications available, but in a compressed format.
At some point (10.3, I think) Apple changed the OS to automatically mount an image file if it contains the only available copy of a requested application - that is, if you double-click on a document which has as it's creator an application in an unmounted (but available), Mac OS X will mount the image file and launch the application.
Until I moved to Intel-based Macs, I had a Classic image file which contained the entire Classic environment - including the few Classic applications I used. Just double-clicking a document which needed GeoQuery (for example) would cause Mac OS X to mount the Classic.dmg volume, launch Classic, launch GeoQuery and open my document.
Pretty slick, no?
------
Mac Help (available from the Finder) has the following regarding .dmg
Seeing the contents of a disk image
A disk image is a copy of the contents of a disk, volume, or folder. Disk images have the filename extension ".dmg" at the end of their names. To see the contents of a disk image, you must first open, or "mount," the disk image, which makes it appear on the desktop or in a Finder window.
To open a disk image, double-click the image on your desktop or in a Finder window.
Once a disk image is opened, you can double-click it to access its contents. To learn more about disk images, open Disk Utility, in the /Applications/Utilities folder, and choose Help > Disk Utility Help.
Reply
George said 2:10PM on 5-04-2007
Another Quick TIP:
If the disk image doesn't have an alias to the Applications folder (or even if it does), click the little blue pill on the right side of the title bar. That will open the links panel on the left side which has the link to the Applications folder, and you can just drag the app over into it.
Reply
Marko said 4:23AM on 5-24-2007
Thanks very much for this info - I just bought my first mac(book) and spent the last two days trying to figure out how DMGs worked and why my apps kept disappearing. I'm no computer neophyte - I've been using Windows - for 17 years, but this was new and really had me baffled. I can well believe that every newbie gets stumped on this. Thanks again!
Reply