콘텐츠로 건너뛰기

Setup OSX-KVM

Reference

https://github.com/kholia/OSX-KVM/blob/master/notes.md

  • Install QEMU and other packages.
sudo apt update

sudo apt-get install qemu-system uml-utilities virt-manager git \
    wget libguestfs-tools p7zip-full make dmg2img tesseract-ocr \
    tesseract-ocr-eng genisoimage vim net-tools screen -y

  • Clone OSX-KVM repository.
cd ~

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

cd OSX-KVM

  • Load KVM module, ignores unknown MSR instructions and continues execution.
sudo modprobe kvm; echo 1 | sudo tee /sys/module/kvm/parameters/ignore_msrs

To 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 only
  • Add user to the kvm and libvirt groups (might be needed).
sudo usermod -aG kvm $(whoami)
sudo usermod -aG libvirt $(whoami)
sudo usermod -aG input $(whoami)

  • Convert the downloaded BaseSystem.dmg file into the BaseSystem.img file.
    You can get BaseSystem.dmg by running ./fetch-macOS-v2.py or extract dmg from iso somewhere.
dmg2img -i BaseSystem.dmg BaseSystem.img

  • Create a virtual HDD image where macOS will be installed. If you change the name of the disk image from mac_hdd_ng.img to something else, the boot scripts will need to be updated to point to the new image name.
qemu-img create -f qcow2 mac_hdd_ng.img 256G
  • Install with CLI method (primary). Just run the OpenCore-Boot.sh script to start the installation process.

태그: