Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save nonkronk/8c5035a05c3faa26cf55d7f15b34b202 to your computer and use it in GitHub Desktop.
Save nonkronk/8c5035a05c3faa26cf55d7f15b34b202 to your computer and use it in GitHub Desktop.
Install macOS Ventura/Sonoma as a VM on Unraid Server using AMD Ryzen 9 5950x + RX 6600 XT

Offline-Install macOS Ventura/Sonoma as a VM on Unraid Server using AMD Ryzen 9 5950x + RX 6600 XT

Installation Preparation

Tools and packages are from OSX-KVM repository.

On Unraid Server

# Download fetch-macOS-v2.py and run_offline.sh script
mkdir /mnt/user/domains/macos-ventura
cd /mnt/user/domains/macos-ventura
# Ventura offline install script
wget https://raw.githubusercontent.com/kholia/OSX-KVM/master/scripts/run_offline.sh
wget https://raw.githubusercontent.com/kholia/OSX-KVM/master/fetch-macOS-v2.py

# Fetch macOS Installer
python3 fetch-macOS-v2.py 

Sample run:

$ ./fetch-macOS-v2.py

1. High Sierra (10.13)
2. Mojave (10.14)
3. Catalina (10.15)
4. Big Sur (11.7)
5. Monterey (12.6)
6. Ventura (13) - RECOMMENDED
7. Sonoma (14)

Choose a product to download (1-6): 6

On other Linux (Ubuntu) VM

We can compile and install packages from source directly on Unraid, but it's easier to do it on a separate VM and mount a SMB/NFS share (in this case: \\unraid-host\\domains).

# Install packages and mount Unraid NFS/SMB share
sudo apt install cifs-utils wget libguestfs-tools make dmg2img genisoimage -y
sudo mkdir /mnt/macos-ventura
sudo mount -t cifs -o rw,nobrl,username=USERNAME,password=PASSWORD //unraid-host/domains/macos-ventura /mnt/macos-ventura

# Download OpenCore
cd /mnt/macos-ventura
wget https://github.com/kholia/OSX-KVM/blob/master/OpenCore/OpenCore.qcow2

# Download & create Offline Ventura Installer (Version: 13.6.4) 
# Reference: https://mrmacintosh.com/macos-ventura-13-full-installer-database-download-directly-from-apple/
wget https://swcdn.apple.com/content/downloads/32/13/052-33049-A_UX3Z28TPLL/702vi772ckrytq1r67eli9zrgsu8jxxoqw/InstallAssistant.pkg
genisoimage -allow-limited-size -l -J -r -iso-level 3 -V InstallAssistant -o InstallAssistant.iso InstallAssistant.pkg run_offline.sh

# Convert the downloaded BaseSystem.dmg file into the BaseSystem.img file.
dmg2img -i BaseSystem.dmg BaseSystem.img

# Create a virtual HDD image where macOS will be installed.
qemu-img create -f qcow2 mac_hdd_ng.img 128G

VM Installation

  • Add a new VM in Unraid using the following settings:

    • OS: Any
    • CPUS: 4 cores
    • Memory: 8GB
    • Machine: Q35
    • BIOS: OVMF
    • Primary vDisk 1, qcow2, SATA: /mnt/user/domains/macos-ventura/OpenCore.qcow2
    • Primary vDisk 2, raw, SATA: /mnt/user/domains/macos-ventura/BaseSystem.img
    • Primary vDisk 3, qcow2, SATA: /mnt/user/domains/macos-ventura/mac_hdd_ng.img
    • Primary vDisk 4, raw, SATA: /mnt/user/domains/macos-ventura/InstallAssistant.iso
  • Create a new VM and edit the XML. Use these WORKING-VM.xml and EFI partition as a reference.

  • Start the VM and open the VNC console. The VM should boot into the macOS installer.

  • Format the virtual HDD that we created before using Disk Utility with name macOS (required).

  • Click Utilities > Terminal and run following command:

sh /Volumes/InstallAssistant/run_offline.sh 
  • Wait and install macOS.

Troubleshooting

Credits

@scockman
Copy link

scockman commented Aug 3, 2024

Is it possible to add a screenshot of the unRAID VM Creation GUI? Followed all the steps here and nothing is bootable. The VM just goes into the EFI shell.

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