1

I want to test Sierra before fully installing it on my computer by creating a Sierra iso installer, which I can use on Virtual Box. When I attempt the first step below (mount the installer image) I get an error from hdutil that the resource is busy. Does anyone have suggestions on how to safely do this?

error: hdiutil: attach failed - Resource busy

steps:

  1. Mount the installer image

    hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify - nobrowse -mountpoint /Volumes/install_app
    
  2. Convert the boot image to a sparse bundle

    hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Sierra
    
  3. Increase the sparse bundle capacity to accommodate the packages

    hdiutil resize -size 8g /tmp/Sierra.sparseimage
    
  4. Mount the sparse bundle for package addition

    hdiutil attach /tmp/Sierra.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build
    
  5. Remove Package link and replace with actual files

    rm /Volumes/install_build/System/Installation/Packages cp -rp /Volumes/install_app/Packages /Volumes/install_build/System/Installation/
    
  6. Unmount the installer image

    hdiutil detach /Volumes/install_app
    

Thanks for your time!

  • 1
    Have a look at my answer, apple.stackexchange.com/questions/253640/… and make sure that the InstallESD.dmg and BaseSystem.dmg files are not mounted before running the script. – user3439894 Oct 23 '16 at 16:20
  • Thanks for your quick response. I'm not sure how to check for that (first time making an ISO). When I ran your script I got this error: christinas-MacBook-Pro:shell_scripts christina$ ./makeSierraISO hdiutil: attach failed - Resource busy ............................................................................................................................. created: /Users/christina/shell_scripts/macOS_Sierra_10.12.0.cdr.dmg /dev/disk4 Apple_partition_scheme – Christina Mitchell Oct 23 '16 at 16:58
  • /dev/disk4s1 Apple_partition_map /dev/disk4s2 Apple_HFS /Volumes/iso Validating target...done Could not recognize "/Volumes/esd/BaseSystem.dmg" as an image file Could not get source volume name rm: /Volumes/OS X Base System/System/Installation/Packages: No such file or directory cp: /Volumes/esd/Packages: No such file or directory cp: directory /Volumes/OS X Base System does not exist hdiutil: detach failed - No such file or directory – Christina Mitchell Oct 23 '16 at 17:01
  • Before you run the script InstallESD.dmg and BaseSystem.dmg cannot already be mounted. Open Disk Utility and if mounted eject them, then run the script. – user3439894 Oct 23 '16 at 17:07
  • 1
    success! "some people encountered black screen upon booting the virtual machine. They reported that changing the default chipset ICH9 to PIIX3 fixes this issue." from this article: ntk.me/2012/09/07/os-x-on-os-x – Christina Mitchell Oct 23 '16 at 20:38
1

I was facing similar issue when I upgraded to Sierra. Adding -force flag resolved issue. Try hdiutil detach -force /Volumes/install_app it might work.

You must log in to answer this question.

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