Skip to content

Instantly share code, notes, and snippets.

@itsmikita
Last active November 12, 2024 10:53
Show Gist options
  • Save itsmikita/bf9dc06000f149fdde11ab4379ac4165 to your computer and use it in GitHub Desktop.
Save itsmikita/bf9dc06000f149fdde11ab4379ac4165 to your computer and use it in GitHub Desktop.
Extract ISO image from macOS Somona installer

Extract ISO Image from a macOS installer

Step 1

Download macOS Installer (InstallAssistant.pkg). Here is the link to Sonoma beta installer:

https://swcdn.apple.com/content/downloads/14/54/042-41491-A_WCZEM7L2US/b5eeeylcnmf82ycto51pvy0klcyzd02on8/InstallAssistant.pkg

Step 2

Run InstallAssistant.pkg by double-clicking on it. This will move Install macOS Sonoma beta.app to /Applications folder.

Step 3

Create a new DMG file, open Terminal and run:

hdiutil create -o /tmp/Somona -size 16000m -volname Somona -layout SPUD -fs HFS+J

The above command will create a 16GB DMG file called Somona in /tmp folder

Step 4

Mount the DMG file we just created:

hdiutil attach /tmp/Somona.dmg -noverify -mountpoint /Volumes/Somona

Step 5

Use createinstallmedia to create the macOS installer on the mounted volume:

sudo /Applications/Install\ macOS\ Sonoma\ beta.app/Contents/Resources/createinstallmedia --volume /Volumes/Somona

Step 6

Unmount the volume we've just created:

sudo hdiutil detach /Volumes/Install\ macOS\ Sonoma\ beta

Step 8

Convert the DMG disk image file to an ISO disk image file (technically a CDR file):

sudo hdiutil convert /tmp/Somona.dmg -format UDTO -o ~/tmp/Somona.cdr

Step 9

Finally rename the CDR file to ISO:

sudo mv ~/tmp/Somona.cdr ~/tmp/Somona.iso

Links & Resources

https://macpaw.com/how-to/create-iso-file

https://osxdaily.com/2020/07/20/how-convert-macos-installer-iso/

@PatrickNehme
Copy link

It worked for me. Thanks!

@mikey0613
Copy link

For Steps 8 & 9, the tilde needs to be removed. The file was created in /tmp, not /tmp...

@rsauve
Copy link

rsauve commented May 15, 2024

Thank you for making this code snipped available.
Here is an updated version as Sonoma is now out out beta.

Extract ISO Image from a macOS installer

Step 1
Download macOS Installer (InstallAssistant.pkg). Here is the link to Sonoma beta installer:
https://swcdn.apple.com/content/downloads/32/06/062-01946-A_0PEP7JHIWA/1pfs4xh22555dj51fkep7w06s4eiezh21p/InstallAssistant.pkg

Step 2
Run InstallAssistant.pkg by double-clicking on it. This will move Install macOS Sonoma beta.app to /Applications folder.

Step 3
Create a new DMG file, open Terminal and run:
hdiutil create -o /tmp/Somona -size 16000m -volname Somona -layout SPUD -fs HFS+J

The above command will create a 16GB DMG file called `Somona in the /tmp directory

Step 4
Mount the DMG file we just created:
hdiutil attach /tmp/Somona.dmg -noverify -mountpoint /Volumes/Somona

Step 5
Use createinstallmedia to create the macOS installer on the mounted volume:
sudo /Applications/Install\ macOS\ Sonoma.app/Contents/Resources/createinstallmedia --volume /Volumes/Somona

Step 6
Unmount the volume we've just created:
sudo hdiutil detach /Volumes/Install\ macOS\ Sonoma

Step 8
Convert the DMG disk image file to an ISO disk image file (technically a CDR file):
sudo hdiutil convert /tmp/Somona.dmg -format UDTO -o /tmp/Somona.cdr

Step 9
Finally rename the CDR file to ISO:
sudo mv /tmp/Somona.cdr /tmp/Somona.iso

@JoeH2510
Copy link

JoeH2510 commented May 15, 2024

Thank you for making this code snipped available. Here is an updated version as Sonoma is now out out beta.

Extract ISO Image from a macOS installer

Step 1 Download macOS Installer (InstallAssistant.pkg). Here is the link to Sonoma beta installer: https://swcdn.apple.com/content/downloads/32/06/062-01946-A_0PEP7JHIWA/1pfs4xh22555dj51fkep7w06s4eiezh21p/InstallAssistant.pkg

Step 2 Run InstallAssistant.pkg by double-clicking on it. This will move Install macOS Sonoma beta.app to /Applications folder.

Step 3 Create a new DMG file, open Terminal and run: hdiutil create -o /tmp/Somona -size 16000m -volname Somona -layout SPUD -fs HFS+J

The above command will create a 16GB DMG file called `Somona in the /tmp directory

Step 4 Mount the DMG file we just created: hdiutil attach /tmp/Somona.dmg -noverify -mountpoint /Volumes/Somona

Step 5 Use createinstallmedia to create the macOS installer on the mounted volume: sudo /Applications/Install\ macOS\ Sonoma.app/Contents/Resources/createinstallmedia --volume /Volumes/Somona

Step 6 Unmount the volume we've just created: sudo hdiutil detach /Volumes/Install\ macOS\ Sonoma

Step 8 Convert the DMG disk image file to an ISO disk image file (technically a CDR file): sudo hdiutil convert /tmp/Somona.dmg -format UDTO -o /tmp/Somona.cdr

Step 9 Finally rename the CDR file to ISO: sudo mv /tmp/Somona.cdr /tmp/Somona.iso

Useful. Thanks

@JoeH2510
Copy link

Step 5 is a invalid command.

Step 5 is a invalid command.

In step 2, you need to click next in the settings window that opens until close.

@rsauve
Copy link

rsauve commented May 15, 2024

Step 5 opens a file called createinstallmedia. The pathway to that file may vary depending on which version of InstallAssistant.pkg you download.
This path:
sudo /Applications/Install\ macOS\ Sonoma.app/Contents/Resources/createinstallmedia
works for the InstallAssistant.pkg downloaded from the link in Step 1.

You can also get to it this way:
sudo "/Applications/Install macOS Sonoma.app/Contents/Resources/createinstallmedia"
which does not look all mangled with the two escape characters as seen in the first line.

The best way to get to createinstallmedia is to use your tab key to autocomplete commands, like this:
sudo /App[TAB]/In[TAB]/Con[TAB/]Re[TAB]/crea[TAB]

Yes, step two is a funny one to try to explain. You just have to know to step through the install procedure until the "Install macOS Sonoma.app" file is copied to the Application folder.

BTW I use iTerm2 instead on MacOS terminal.

@HK51503
Copy link

HK51503 commented May 16, 2024

Some of "Sonoma" is wrongly written "Somona". I got an error and wondered why for few seconds.

@h-lunah
Copy link

h-lunah commented Jun 19, 2024

June 10 2024 update:

Step 3 now requires 16250m instead of 16000m to fit the macOS 15 Sequoia beta

Here is the updated tutorial:

Extract ISO Image from a macOS installer

Step 1

Download macOS Installer (InstallAssistant.pkg). Here is the link to Sequoia beta installer:

https://swcdn.apple.com/content/downloads/50/33/052-49060-A_SUZPTRSXUG/rshd6um52uzcxnr1u85utqhl124vmsph1c/InstallAssistant.pkg

Step 2

Run InstallAssistant.pkg and go through the installeer. This will move Install macOS 15 beta.app to /Applications folder.

Step 3

Create a new DMG file, open Terminal and run:

hdiutil create -o /tmp/Sequoia -size 16250m -volname Sequoia -layout SPUD -fs HFS+J

The above command will create a 16GB DMG file called Sequoia in /tmp folder

Step 4

Mount the DMG file we just created:

hdiutil attach /tmp/Sequoia.dmg -noverify -mountpoint /Volumes/Sequoia

Step 5

Use createinstallmedia to create the macOS installer on the mounted volume:

sudo /Applications/Install\ macOS\ 15\ beta.app/Contents/Resources/createinstallmedia --volume /Volumes/Sequoia

Step 6

Unmount the volume we've just created:

sudo hdiutil detach /Volumes/Install\ macOS\ 15\ beta

Step 8

Convert the DMG disk image file to an ISO disk image file (technically a CDR file):

sudo hdiutil convert /tmp/Sequoia.dmg -format UDTO -o ~/Sequoia.cdr

Step 9

Finally rename the CDR file to ISO:

sudo mv ~/Sequoia.cdr ~/Sequoia.iso

Links & Resources

https://macpaw.com/how-to/create-iso-file

https://osxdaily.com/2020/07/20/how-convert-macos-installer-iso/

@h-lunah
Copy link

h-lunah commented Jun 19, 2024

It is also recommended to use some kind of virtual Mac for this if you don't have a real Mac.

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