Skip to content

Instantly share code, notes, and snippets.

@arobb
Last active November 24, 2020 13:15
Show Gist options
  • Star 59 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save arobb/447a962af4f07ef81e79987d686275e5 to your computer and use it in GitHub Desktop.
Save arobb/447a962af4f07ef81e79987d686275e5 to your computer and use it in GitHub Desktop.
Install macOS Sierra in VirtualBox on macOS host

Step 1 (Creating a bootable macOS Sierra ISO for VirtualBox):

  1. hdiutil attach /Applications/Install\ macOS\ Sierra\ Public\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
  2. hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
  3. hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
  4. asr restore -source /Volumes/install_app/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
  5. rm /Volumes/OS\ X\ Base\ System/System/Installation/Packages
  6. cp -rp /Volumes/install_app/Packages /Volumes/OS\ X\ Base\ System/System/Installation/
  7. cp -rp /Volumes/install_app/BaseSystem.chunklist /Volumes/OS\ X\ Base\ System/BaseSystem.chunklist
  8. cp -rp /Volumes/install_app/BaseSystem.dmg /Volumes/OS\ X\ Base\ System/BaseSystem.dmg
  9. hdiutil detach /Volumes/install_app
  10. hdiutil detach /Volumes/OS\ X\ Base\ System/
  11. hdiutil convert /tmp/Sierra.cdr.dmg -format UDTO -o /tmp/Sierra.iso
  12. mv /tmp/Sierra.iso.cdr ~/Desktop/Sierra.iso

Step 2 (Installing in VirtualBox)

This is pretty straightforward.

  1. Create a new El Capitan (there is no option for Sierra at the moment) machine. Leave everything at default
  2. Boot the virtual machine from the Sierra.iso you created, which you'll find on your desktop. I had to mash F12 while the machine was starting up and then choose 'EFI CD/DVD' in the boot manager. YMMV.
  3. The install process should be familiar to you. If not, you probably shouldn't be playing with a beta OS ;)
  4. Grab a coffee, the 15 minute estimation the installer gives you is a complete work of fiction. My install took over an hour.
  5. Once installed, reboot and complete the new user process. Skip the AppleID login bit, it'll fail on a VirtualBox.
  6. Shut down the virtual machine and quit VirtualBox.
@samiyuru
Copy link

If you are trying this with Catalina you can use this script to create the installer media that can be mounted directly on Virtualbox. More information can be found here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment