Install macOS on an external hard drive - crc-org/vfkit GitHub Wiki

For vfkit testing, it's useful to have older/newer macOS versions easily available. I did this using an external hard drive and with the help of this article. If you want to install an older version of macOS than the one on your mac, some form of USB key/SD card/... for the installer is needed. You can install a newer macOS version from your current macOS instance, just run the installer once it's downloaded, and point it at the external hard drive instead of your local disk.

  • Prepare the external hard drive
    • Plug the external hard drive
    • Start Disk Utility
    • Click on View/Show all devices
    • Erase the whole external hard drive, format it as AFPS and use a GUID partition table
  • Get the installation files
    • Download the macOS version you want from the Mac App Store. I had to go through a search engine to find the correct links, for example, macOS 12 (Monterey).
    • Once it's downloaded, run sudo /Applications/Install\ macOS\ Monterey.app/Contents/Resources/createinstallmedia --volume /Volumes/macOS\ Installer (I created reformatted the SD card I used in Disk Utility and named it macOS Installer). Apple documents this here.
  • Install macOS
    • Shutdown the mac
    • M1: Turn it on and hold the power button until it tells you it is opening the startup menu
    • Intel: Turn it on and hold the option key until it opens the startup menu
    • Pick the device where you put the installation files
    • This will start the installation process, tell it to install to the external hard drive
    • The process will take some time and reboot the mac a few times
  • Et voilà! Once this completes, it will reboot into the macOS you just installed

It's possible to install multiple macOS versions on the same drive by creating more APFS volumes, and telling macOS to install on a different volume each time. It's not possible to rename a volume after macOS has been installed to it, so make sure to use descriptive volume names from the start. macOS shows the volume names in its boot manager.

Some post-install steps:

  • Install brew, this will install the xcode command line tools which include git
  • Install go. This can be done from the command line with sudo installer -pkg $(GOPKG) -target /
  • Enable ssh from macOS sharing options (remote session)