Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I want to install a dmg file on a remote server. All I have is an ssh access. Since a DMG is a disk image, I tried to mount it, but mount does not seem to recognize its format.

file says my dmg file is a VAX COFF executable.

share|improve this question

3 Answers 3

up vote 10 down vote accepted

First, mount the dmg image : sudo hdiutil attach <image>.dmg

The image will be mounted to /Volumes/<image>. Mine contained a package which i installed with: sudo installer /Volumes/<image>/<image>.pkg -target /.

Finally unmount the image: sudo hdiutil detach /Volumes/<image>.

share|improve this answer
    
So is this how it works on Ask Different? You take someone else's answer and then re-post it as your own, answering your own question? –  trojanfoe Dec 5 '12 at 9:47
    
@trojanfoe You actually provided a part of the answer while I was researching and answering my own question ; and I up voted your answer. –  philant Dec 5 '12 at 10:10
    
If you were able to answer the question by yourself they why post the question at all? –  trojanfoe Dec 5 '12 at 10:15
2  
@philant, I believe you have a typo. The installer line (for me) is sudo installer -package /Volumes/<image>/<image>.pkg -target / –  ghayes Mar 5 at 20:09
1  
Perhaps @philant wasn't comfortable editing your post, trojanfoe - so the important idea is getting the answers out while giving proper credit where due. –  bmike Mar 5 at 20:36

You should be able to mount the .dmg using:

hdiutil attach /path/to/file.dmg

And then copy its contents (which appears in /Volumes) where ever you like.

share|improve this answer

You could try the command open disk://host.tld/image.dmg.

share|improve this answer
    
open didn't do anything, just exit, without error message. –  philant Dec 5 '12 at 9:36
1  
Yes it does. I just tested it. It won't display anything until the disk image has been completely mounted, so you will have to wait a minute or so before it appears in /Volumes. (It works if you ssh in and type open path/to/file.dmg. I don't think disk://host.tld/ works though.) –  daviewales Dec 5 '12 at 12:19
    
Helpful, though maybe not exactly what the OP needed. Thanks. –  Danny Whitt Feb 9 at 12:06

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.