System spec:
- Intel core i5 8600k on Gigabyte z370m d3h motherboard with Bios version f10
(didn’t work with f4 bios) - Sapphire AMD RX 560 daughter-board
Bios setting:
- CSM on with UEFI for pci
- Integrated gfx on and set as primary output
Host Os:
- Fedora 28 on mainline 4.20 rc3 linux
- Monitor plugged to motherboard’s hdmi output.
Kernel parameters:
In /etc/default/grub
GRUB_CMDLINE_LINUX="nouveau.blacklist=1 resume=/dev/mapper/fedora-swap rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb intel_iommu=on iommu=pt quiet splash"
Do sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
for effect.
Check output of lspci -k
after reboot: look for VGA Comatible controller.
Under that kernel driver in use
line shoud have vfio instead of amdgpu.
Software:
-
Install virt-manager with
sudo dnf install virt-manager
. -
Get Kholia’s OSX-KVM repo with
git clone https://github.com/kholia/OSX-KVM
-
cd into OSX-KVM.
-
Create a qcow2 image of greater than 20 GB size with
qemu-img create -f qcow2 hdd.qcow2 25000M
inside this folder. -
Copy High Sierra installation iso as installer.iso into this folder.
(Try websearchingfor how to create High Sierra installer iso with clover
) -
Modify macOS-HS-libvert.xml according to your location of OVMF_CODE.fd, OVMF_VARS.fd, Clover.qcow2 (this 3 comes with repo) and hdd.qcow2 and installer.iso (these 2 you have created).
-
Create a vm instance for virt-manager with this command
virsh --connect qemu:///system define macOS-HS-libvirt.xml
-
Open virt-manager and open this vm instance and try to run it.
-
In my case access is denied for OVMF_CODE.fd. I fixed it by adding OVMF_CODE.fd as new storage in device in virt-manager. That fixes ownership and permission of this file. (Something’s wrong with my /etc/libvirt/qemu.conf file).
-
Run the system and install os.
-
After Installation select vm on virt-manager. Open it(don’t run). Select show virtual hardware detaills tab(which looks like a light bulb). Add new device. Select host pci device and choose your graphics card.
-
Similarly add mouse and keyboard (you need extra pair) to vm.
-
Remove first Display Spice then Video QXL entry from there.
-
Plug a monitor into your graphic cards output ( You need 2 monitors, or if your monitor has 2 input you can plug into their and switch between them).
-
Run vm.
Problems:
- EFI_FSB_frequency issue: VM is superfast (10 times). Try watching a video.
Potential fix: Adding following to EFI/CLOVER/config.plist inside EFI partition of VM
<key>CPU</key> <dict> <key>BusSpeedkHz</key> <string>1000000</string> <key>QEMU</key> <true/> </dict>
I’ve failed to do so because it’s impossible to type.
- Second issue is vm can be run once, then host has to reboot for subsequent usage.
Without host reboot there is either no display output or stuck at fruit logo.