MacOS – How to create a macOS Sierra iso installer successfully

command lineisomacosUtilities

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!

Best Answer

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.