Create Mac OS ISO

on March 17, 2023, 3:42 p.m.

Supposedly, the following command to create the DMG is supposed to be the same thing as doing it from the GUI, but I get errors about erasing the DMG later in the process when I do. So create it via the GUI if you get an error.
sudo hdiutil create -o ~/Desktop/Ventura -size 16000m -volname Ventura -layout SPUD -fs 'Case-sensitive Journaled HFS+'

Mount the DMG file. Assumes the DMG is on the Desktop and named Ventura
hdiutil attach ~/Desktop/Ventura.dmg -noverify -mountpoint /Volumes/Ventura

Copy the files from the install DMG you downloaded from the app store to the DMG volume.
sudo /Applications/Install\ macOS\ Ventura.app/Contents/Resources/createinstallmedia --volume /Volumes/Ventura --nointeraction

Unmount the DMG
hdiutil detach /Volumes/Install\ macOS\ Ventura

Convert the DMG to CDR
hdiutil convert ~/Desktop/Ventura.dmg -format UDTO -o ~/Desktop/Ventura.cdr

Rename the file to ISO
mv -v ~/Desktop/Ventura.cdr ~/Desktop/Ventura.iso