Howto macOS sonoma kvm: Difference between revisions

From Vidalinux Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 27: Line 27:
create a virtual disk image where macos will be installed:
create a virtual disk image where macos will be installed:
  qemu-img create -f qcow2 mac_hdd_ng.img 256G
  qemu-img create -f qcow2 mac_hdd_ng.img 256G
edit OpenCore-Boot.sh and change ALLOCATED_RAM:
ALLOCATED_RAM="8192"
edit OpenCore-Boot.sh and change installation media controller to virtio:
#-device ide-hd,bus=sata.3,drive=InstallMedia
-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",if=virtio,format=raw
edit OpenCore-Boot.sh and change sata for virtio in the following line:
-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",if=virtio,format=qcow2
#-device ide-hd,bus=sata.4,drive=MacHDD

Revision as of 23:54, 30 May 2024

clone the git repo:

git clone --depth 1 --recursive https://github.com/kholia/OSX-KVM.git
cd OSX-KVM

kvm need this tweak on the host machine to work:

sudo modprobe kvm; echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs

make this change permanent, you may use the following command:

sudo cp kvm.conf /etc/modprobe.d/kvm.conf  # for intel boxes only
sudo cp kvm_amd.conf /etc/modprobe.d/kvm.conf  # for amd boxes onlyn

add user to the kvm and libvirt groups:

sudo usermod -aG kvm $(whoami)
sudo usermod -aG libvirt $(whoami)
sudo usermod -aG input $(whoami)

fetch macOS installer.

./fetch-macOS-v2.py

select option 7 for sonoma:

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): 7

convert the downloaded BaseSystem.dmg file into the BaseSystem.img file:

dmg2img -i BaseSystem.dmg BaseSystem.img

create a virtual disk image where macos will be installed:

qemu-img create -f qcow2 mac_hdd_ng.img 256G

edit OpenCore-Boot.sh and change ALLOCATED_RAM:

ALLOCATED_RAM="8192"

edit OpenCore-Boot.sh and change installation media controller to virtio:

#-device ide-hd,bus=sata.3,drive=InstallMedia
-drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",if=virtio,format=raw

edit OpenCore-Boot.sh and change sata for virtio in the following line:

-drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",if=virtio,format=qcow2
#-device ide-hd,bus=sata.4,drive=MacHDD