Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ To build a VM running macOS, follow the directions below:
- type: `Mac OS X`
- version: `Mac OS X (64-bit)`.
5. Follow the rest of the VM creation wizard and either leave the defaults or adjust to your liking.
- For Big Sur, the installer requires the disk to have at least 35.3 GB.
6. Go into the Settings for the new VM you created and:
1. Under 'Display', increase the Video Memory to at least 128MB, otherwise macOS might not boot correctly, and display performance will be abysmal.
2. Under 'Audio', uncheck 'Enable Audio', otherwise the VM may display 'choppy' performance.
Expand Down Expand Up @@ -54,7 +55,7 @@ To build a VM running macOS, follow the directions below:
- If keyboard and mouse do not work inside the VM:
1. Ensure the VirtualBox Extension Pack is installed.
2. In the VM settings, under `Ports > USB`, select `USB 3.0 (xHCI) Control`.

- If for Big Sur the installer says `The selected volume is not large enough to install on. A minimum of 35.3 GB is required.`, shutdown the VM, go to File > Virtual Media Manager, and increase the disk size. Now, restart the VM, go to Disk Utility, delete the too-small partition and re-create it to use all of the available space.
## Larger VM Screen Resolution

To control the screen size of your macOS VM:
Expand Down
63 changes: 41 additions & 22 deletions prepare-iso.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,23 @@ function createISO()

# echo Debug: installerAppName = ${installerAppName} , isoName = ${isoName}

echo
echo Create ${isoName} blank ISO image with a Single Partition - Apple Partition Map
echo --------------------------------------------------------------------------
# Just in case - delete any previous sparseimage
[ -e /tmp/${isoName}.sparseimage ] && rm -f /tmp/${isoName}.sparseimage
# increased size to 16G - 8G is too small for Catalina
echo $ hdiutil create -o /tmp/${isoName} -size 16g -layout SPUD -fs HFS+J -type SPARSE
hdiutil create -o /tmp/${isoName} -size 16g -layout SPUD -fs HFS+J -type SPARSE

Comment on lines +29 to +37
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, this block was just moved up since Big Sur will mount this as the installer image, install_app.

echo
echo Mount the installer image
echo -----------------------------------------------------------

if [ -e "${installerAppName}" ] ; then
if [ "${isoName}" == "BigSur" ] ; then
echo $ hdiutil attach /tmp/${isoName}.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil attach /tmp/${isoName}.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_app
elif [ -e "${installerAppName}" ] ; then
echo $ hdiutil attach "${installerAppName}"/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil attach "${installerAppName}"/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
error=$?
Expand All @@ -45,29 +57,24 @@ function createISO()
fi

if [ ${error} -ne 0 ] ; then
echo "Failed to mount the InstallESD.dmg from the instaler at ${installerAppName}. Exiting. (${error})"
echo "Failed to mount the InstallESD.dmg from the installer at ${installerAppName}. Exiting. (${error})"
return ${error}
fi

echo
echo Create ${isoName} blank ISO image with a Single Partition - Apple Partition Map
echo --------------------------------------------------------------------------
# Just in case - delete any previous sparseimage
[ -e /tmp/${isoName}.sparseimage ] && rm -f /tmp/${isoName}.sparseimage
# increased size to 16G - 8G is too small for Catalina
echo $ hdiutil create -o /tmp/${isoName} -size 16g -layout SPUD -fs HFS+J -type SPARSE
hdiutil create -o /tmp/${isoName} -size 16g -layout SPUD -fs HFS+J -type SPARSE

echo
echo Mount the sparse bundle for package addition
echo --------------------------------------------------------------------------
echo $ hdiutil attach /tmp/${isoName}.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build
hdiutil attach /tmp/${isoName}.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build
if [ "${isoName}" != "BigSur" ] ; then
echo
echo Mount the sparse bundle for package addition
echo --------------------------------------------------------------------------
echo $ hdiutil attach /tmp/${isoName}.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build
hdiutil attach /tmp/${isoName}.sparseimage -noverify -nobrowse -mountpoint /Volumes/install_build
fi

echo
echo Restore the Base System into the ${isoName} ISO image
echo --------------------------------------------------------------------------
if [ "${isoName}" == "HighSierra" ] || [ "${isoName}" == "Mojave" ] || [ "${isoName}" == "Catalina" ] ; then
if [ "${isoName}" == "BigSur" ] ; then
echo "N/A skipping..."
elif [ "${isoName}" == "HighSierra" ] || [ "${isoName}" == "Mojave" ] || [ "${isoName}" == "Catalina" ] ; then
echo $ asr restore -source "${installerAppName}"/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
#following asr command returns an error and prints:
#"Personalization succeeded"
Expand All @@ -84,7 +91,9 @@ function createISO()
echo
echo Remove Package link and replace with actual files
echo --------------------------------------------------------------------------
if [ "${isoName}" == "Mojave" ] || [ "${isoName}" == "Catalina" ] ; then
if [ "${isoName}" == "BigSur" ] ; then
echo "N/A skipping..."
elif [ "${isoName}" == "Mojave" ] || [ "${isoName}" == "Catalina" ] ; then
echo $ ditto -V /Volumes/install_app/Packages /Volumes/macOS\ Base\ System/System/Installation/
ditto -V /Volumes/install_app/Packages /Volumes/macOS\ Base\ System/System/Installation/
elif [ "${isoName}" == "HighSierra" ] ; then
Expand All @@ -100,7 +109,10 @@ function createISO()
echo
echo Copy macOS ${isoName} installer dependencies
echo --------------------------------------------------------------------------
if [ "${isoName}" == "Mojave" ] || [ "${isoName}" == "Catalina" ] ; then
if [ "${isoName}" == "BigSur" ] ; then
echo $ sudo /Applications/"${installerAppName}"/Contents/Resources/createinstallmedia --volume /Volumes/install_app --nointeraction
sudo /Applications/"${installerAppName}"/Contents/Resources/createinstallmedia --volume /Volumes/install_app --nointeraction
elif [ "${isoName}" == "Mojave" ] || [ "${isoName}" == "Catalina" ] ; then
echo $ ditto -V "${installerAppName}"/Contents/SharedSupport/BaseSystem.chunklist /Volumes/macOS\ Base\ System/BaseSystem.chunklist
ditto -V "${installerAppName}"/Contents/SharedSupport/BaseSystem.chunklist /Volumes/macOS\ Base\ System/BaseSystem.chunklist
echo $ ditto -V "${installerAppName}"/Contents/SharedSupport/BaseSystem.dmg /Volumes/macOS\ Base\ System/BaseSystem.dmg
Expand All @@ -120,13 +132,20 @@ function createISO()
echo
echo Unmount the installer image
echo --------------------------------------------------------------------------
echo $ hdiutil detach /Volumes/install_app
hdiutil detach /Volumes/install_app
if [ "${isoName}" == "BigSur" ] ; then
echo $ hdiutil detach /Volumes/"Install macOS Big Sur"
hdiutil detach /Volumes/"Install macOS Big Sur" -force # NOTE: force because "Resource busy"
else
echo $ hdiutil detach /Volumes/install_app
hdiutil detach /Volumes/install_app
fi

echo
echo Unmount the sparse bundle
echo --------------------------------------------------------------------------
if [ "${isoName}" == "Mojave" ] || [ "${isoName}" == "Catalina" ] ; then
if [ "${isoName}" == "BigSur" ] ; then
echo "N/A skipping..."
elif [ "${isoName}" == "Mojave" ] || [ "${isoName}" == "Catalina" ] ; then
echo $ hdiutil detach /Volumes/macOS\ Base\ System/
hdiutil detach /Volumes/macOS\ Base\ System/
else
Expand Down