Skip to content

Instantly share code, notes, and snippets.

@xbalaji
Last active June 25, 2023 01:50
Show Gist options
  • Save xbalaji/87da0277f20128c3fb03af77ee66b366 to your computer and use it in GitHub Desktop.
Save xbalaji/87da0277f20128c3fb03af77ee66b366 to your computer and use it in GitHub Desktop.
create-macos-vm
# create a volume, attach it, erase the disk, save the install app to it
hdiutil create -o macos/Catalina -size 10g -volname Catalina -layout SPUD -fs HFS+J
hdiutil attach macos/Catalina.dmg -noverify -mountpoint /Volumes/Catalina
DISKNUM=$(df -h /Volumes/Catalina | tail -1 | cut -c6-10)
diskutil eraseDisk JHFS+ Catalina ${DISKNUM}
# now install the macos on to the mounted volume
"/Applications/Install macOS Catalina.app/Contents/Resources/createinstallmedia" --volume /Volumes/Catalina/ --nointeraction
# convert to img
dd if=/dev/${DISKNUM} bs=1m of=macos/Catalina.img
# detach the volume
hdiutil detach ${DISKNUM}
# use the img to create VM
# see here: https://applehint.com/t/step-by-step-to-install-macos-10-15-catalina-on-vmware-on-windows-pc/1507
## hints
## patch vmware player to handle mac-os
# https://github.com/paolo-projects/unlocker/releases/tag/3.0.3
## utility download using script
## https://github.com/corpnewt/gibMacOS
## reddit documentation
## https://www.reddit.com/r/hackintosh/comments/efjy5g/how_to_download_macos_from_apples_official/
## # convert to bootable iso
## hdiutil makehybrid -iso -joliet -o macos/Catalina.iso macos/Catalina.iso
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment