MacOSのインストーラからisoファイルを生成する
端的にはMacOSのインストーラをダウンロードした後に下記を実行(これはMojaveに対するものなのでMojaveと書いてある部分は適宜書き換える必要があるが)
code:bash
$ hdiutil create -o /tmp/Mojave -size 8G -layout SPUD -fs HFS+J -type SPARSE
$ hdiutil attach /tmp/Mojave.sparseimage -noverify -mountpoint /Volumes/install_build
$ sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build
$ hdiutil detach /Volumes/Install\ macOS\ Mojave/
$ hdiutil convert /tmp/Mojave.sparseimage -format UDTO -o /tmp/Mojave.iso
$ mv /tmp/Mojave.iso.cdr ~/Desktop/Mojave.iso
$ rm /tmp/Mojave.sparseimage
参考資料
https://qiita.com/LxrunYutaKojima/items/305af39f3443d053b75e
http://www.mindto01s.com/2018/07/24/7b66f018_7d1d_468e_ab70_bcdeac4b0d80.html
http://www.mindto01s.com/2018/07/05/befb9703_935b_43bd_9383_6fbdce038b48.html
https://tobiwashere.de/2017/10/virtualbox-how-to-create-a-macos-high-sierra-vm-to-run-on-a-mac-host-system/
これはHigh Sierraの記事だが、各コマンドの意味合いまで説明されており、良い