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!

klanomath
  • 66,391
  • 9
  • 130
  • 201
  • 1
    Have a look at my answer, http://apple.stackexchange.com/questions/253640/install-sierra-as-guest-os-in-vm-with-parallels-12/253644?s=2|0.4333#253644 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
  • The script now runs, but the installer doesn't work in the iso. When I start virtual box, it returns a black screen. – Christina Mitchell Oct 23 '16 at 17:50
  • I no longer use VirtualBox as it never really supported OS X/macOS as good as VMware Fusion does, so I really can't offer any help with VB. The script I pointed you to creates a bootable installer image that works in VMware Fusion and Parallels Desktop, so theoretically it should also work in VirtualBox. That said, as bad as VirtualBox was at running OS X, I wouldn't waist my time with it even just to evaluate, I'd use VMware Fusion or Parallels Desktop. Even then, not all features are supported in a VM but you'd get a better evaluation then with VB. Both VMware & Parallels have free trials. – user3439894 Oct 23 '16 at 18:39
  • 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: http://ntk.me/2012/09/07/os-x-on-os-x/ – Christina Mitchell Oct 23 '16 at 20:38

1 Answers1

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.

nepaash
  • 11