25

Every time I install an app, I get a DMG file showing up on the desktop. It looks like this:

Mounted DMGs

How do I hide it on the desktop or keep them elsewhere to preserve the aesthetic?

When I Control + click on it, I don't see any way to hide it.

Also, when I do ls -al on the desktop, they never show up. Why is that?

36

What you're seeing is the mounted disk image, you need to eject them.

These are no different than a USB disk or flash drive that you attach or a CD/DVD media that you load into a drive. It will show up on your Desktop so you have an easy way to access them. Once you're done installing them, you can simply right click and then select Eject.

For example, I double clicked a (random) DMG file (Western Digital macOS Apps) that was in a different directory (from my Desktop) and the mounted file shows up on the Desktop. If you double click, you will see the contents (usually install scripts or the App to be copied to the /Applications folder). When you're done, right click and select Eject. Note, many newer apps (VirtualBox I know does this) will, as part of it's script eject and move the DMG to Trash for you.

enter image description here

If using Terminal, you can see them by listing the contents of /Volumes:

% ls /Volumes

You cannot delete the item; if you drag it to the Trash, the trash icon will turn into the Eject Symbol.

Eject Animation

| improve this answer | |
29

If you want to eject the mounted DMG, please see Allan's excellent answer - or more simply do a secondary click on the DMG icon and select the Eject option.

However, if you want to keep the DMG mounted, but don't want it to appear on your desktop, you can do that too! Go to Finder → Preferences → General, and under "Show these items on the desktop:" uncheck "External disks".

Note that this will also cause USB keys and similar to not appear on the desktop; you can access them from the Sidebar in Finder.

Finder Preferences

| improve this answer | |
  • 5
    Little note: I wrote this because the question said "My question is, how do I hide it on the desktop/*keep them elsewhere* to preserve the aesthetic?" (emphasis mine), so I thought they might want to know how to keep the disk mounted. – Wowfunhappy Aug 23 at 23:05
  • 2
    It seems pretty clear that this is the correct answer. – Seamus Aug 24 at 19:49
  • 2
    an ejection will unmount but that doesn't mean they were deleted. The .dmg files themselves will still be in (most likely) the Downloads folder in Finder – NKCampbell Aug 24 at 20:58
  • 2
    I’m reading this over @Seamus and the question is about the images left after installing an application. @Allan’s answer is more correct because it addresses the problem presented by the OP. Why would you keep these mounted after installing the app. This answer is good, too, because of additional info but you wouldn’t do this with install images. – Doug Masters Aug 25 at 14:58
  • 2
    @Seamus What people ask and what they want are not always necessarily the same thing, especially when they might be somewhat unfamiliar with the subject matter. – 8bittree Aug 26 at 14:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .