Mounting OSX .DMG images from shell

This is an easy way to mount OS X installer packages (.dmg files) from the command line tool.

First of all, you must have your .DMG file, or you can download it still using the shell.

To download with command line use the curl command:

MacMini>curl > myFile.dmg

Then to mount the image use the following command:

MacMini> hdid myFile.dmg

That’s all!

MacMini: enabling deep sleep

If you want to enable the windows-like “hibernation” feature on your mac mini, this is your post.

  1. Go to and download the .dmg
  2. Double click on the .dmg file.
  3. Double click on the “Deep Sleep” icon and install it.
  4. Launch Terminal application, located in the Utilities folder in the Application folder
  5. Now you have to execute some commands:
    1. With an administrator user type:
      sudo pmset -a hibernatemode 3
    2. Check if the file located in /private/var/vm/sleepimage exists, if not repeat command 1 again.
    3. Now, you have to fix a little issue.
      Go to your home folder, the to Library folder and then Widgets one.
    4. Select “Deep Sleep” and right-click on it. Choose “Package Contents”.
    5. In the terminal window type: cd /Library/Widgets/Deep\ Sleep.wdg/
    6. Now fix the issue: chown root:wheel deepsleep
    7. And again: chmod 4755 deepsleep
    8. At this point, everything should works.

Click on the widgets icon on the toolbar, then click on Deep sleep.
To wake up your mini, click on the power button on the back side.