### macOS Sonoma support - Change `Penryn` to `Haswell-noTSX` in OpenCore-Boot.sh file. - This worked fine even on a `AMD Ryzen 9 5900HS` CPU. ### App Store problems Do you see the "Your device or computer could not be verified" message when you try to login to the App Store? If yes, here are the steps to fix it. - Make sure that your wired ethernet connection is called "en0" (and not "en1" or something else). Use "ifconfig" command to verify this. - If the wired ethernet connection is not called "en0", then then go to Network in System Preferences and delete all the devices, and apply the changes. Next, go to the console and type in `sudo rm /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist`. Finally reboot, and then use the App Store without problems. This fix was found by `Glnk2012` of https://www.tonymacx86.com/ site. Also tweaking the `smbios.plist` file can help (?). ### Resolution in Ventura Update: Switching to `vmware-svga` device seems to have "fixed" the following problem! ... From https://superuser.com: macOS Ventura screen resolution settings includes only 3 predefined options but choosing any of them breaks my installation (I'm getting black screen with only small portion visible). Process to reset the resolution (using that small visible) display portion: Log in (in a blind fashion!), open Terminal and run the following commands: ``` sudo rm /Library/Preferences/com.apple.windowserver.plist rm ~/Library/Preferences/ByHost/com.apple.windowserver* sudo reboot ``` Reboot the macOS Ventura VM. Note: Running `displayplacer "id:FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF mode:10"` doesn't help with this resolution problem on macOS Ventura. ### Change resolution in OpenCore ```diff diff --git a/OpenCore/config.plist b/OpenCore/config.plist index 4754e8c..489570f 100644 --- a/OpenCore/config.plist +++ b/OpenCore/config.plist @@ -692,7 +692,7 @@ Resolution - Max + 1920x1080 ``` Ensure that the OVMF resolution is set equal to resolution set in your OpenCore qcow2 file (default is 1024x768). This can be done via the OVMF menu, which you can reach with a press of the ESC button during the OVMF boot logo (before OpenCore boot screen appears). In the OVMF menu settings, set Device Manager -> OVMF Platform Configuration -> Change Preferred Resolution for Next Boot to the desired value (default is 1024x768). Commit changes and exit the OVMF menu. Note: The macOS VM's resolution can be changed via `Settings -> Displays` option easily. Note: After changing the `config.plist` file, please regenerate the `OpenCore.qcow2` file using the [instructions](./OpenCore/README.md#notes) included in this repository. ### GPU passthrough notes These steps will need to be adapted for your particular setup. A host machine with IOMMU support is required. Consult [this Arch Wiki article](https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF) for general-purpose guidance and details. I am running Ubuntu 22.04.4 LTS on Intel i5-6500 + ASUS Z170-AR motherboard + AMD RX 6600 GPU (April 2024). - Blacklist the required kernel modules. ``` $ cat /etc/modprobe.d/blacklist.conf ... blacklist amdgpu blacklist radeon ``` - Find details of the PCIe devices to passthrough. ``` $ lspci -nnk | grep AMD 01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] [1002:67df] (rev ef) 01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] [1002:aaf0] ``` - Enable IOMMU support and configure VFIO. Append the given line to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub`. ##### Intel CPU Systems `iommu=pt intel_iommu=on vfio-pci.ids=1002:67df,1002:aaf0 kvm.ignore_msrs=1 video=vesafb:off,efifb:off` ##### AMD CPU Systems `iommu=pt amd_iommu=on ` - Tweak module configuration a bit according to the following output (thanks to Mathias Hueber). ``` $ cat /etc/modprobe.d/vfio.conf options vfio-pci ids=1002:67df,1002:aaf0 disable_vga=1 softdep radeon pre: vfio-pci softdep amdgpu pre: vfio-pci softdep nouveau pre: vfio-pci softdep drm pre: vfio-pci ``` - Update GRUB, initramfs, and then reboot. ``` sudo update-grub2 sudo update-initramfs -k all -u ``` - In the BIOS setup, set the `Primary Display` to `IGFX` (aka CPU graphics / onboard graphics). Tip: Update the BIOS! - Verify that the IOMMU ("VT-d" for Intel) is enabled, and `vfio-pci` is working as expected. Verify that the expected devices are using `vfio-pci` as their kernel driver. ``` $ dmesg | grep -i iommu [ 0.076879] DMAR: IOMMU enabled [ 0.183732] DMAR-IR: IOAPIC id 2 under DRHD base 0xfed91000 IOMMU 1 [ 0.330654] iommu: Default domain type: Passthrough (set via kernel command line) [ 0.489615] pci 0000:00:00.0: Adding to iommu group 0 [ 0.489627] pci 0000:00:01.0: Adding to iommu group 1 [ 0.489634] pci 0000:00:02.0: Adding to iommu group 2 [ 0.489643] pci 0000:00:14.0: Adding to iommu group 3 ``` ``` $ dmesg | grep vfio [ 0.526198] vfio-pci 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem [ 0.543768] vfio_pci: add [1002:67df[ffffffff:ffffffff]] class 0x000000/00000000 [ 0.563765] vfio_pci: add [1002:aaf0[ffffffff:ffffffff]] class 0x000000/00000000 [ 3.384597] vfio-pci 0000:01:00.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem ``` ``` $ lspci -nkk -d 1002:67df 01:00.0 0300: 1002:67df (rev ef) Subsystem: 1da2:e366 Kernel driver in use: vfio-pci Kernel modules: amdgpu ``` ``` $ ./scripts/list_iommu_groups.sh IOMMU Group 0: 00:00.0 Host bridge [0600]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers [8086:191f] (rev 07) IOMMU Group 1: 00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor PCIe Controller (x16) [8086:1901] (rev 07) 01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] [1002:67df] (rev ff) 01:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] [1002:aaf0] (rev ff) ``` - Fix permissions for the `/dev/vfio/1` device (modify as needed): ``` sudo cp vfio-kvm.rules /etc/udev/rules.d/vfio-kvm.rules sudo udevadm control --reload sudo udevadm trigger ``` - Open `/etc/security/limits.conf` file and add the following lines: ``` @kvm soft memlock unlimited @kvm hard memlock unlimited @libvirt soft memlock unlimited @libvirt hard memlock unlimited ``` Thanks to `Heiko Sieger` for this solution. - Confirm the contents of `boot-passthrough.sh` and run it to boot macOS with GPU passthrough. - To reuse the keyboard and mouse devices from the host, setup "Automatic login" in System Preferences in macOS and configure Synergy software. Note: On `Pop!_OS`, use the `kernelstub` command to change the kernel boot arguments. Note 2: Use [AMD VBFlash](https://www.techpowerup.com/download/ati-atiflash/) to dump the AMD GPU bios, and pass on to QEMU. This is especially required if your AMD GPU is not starting up properly (resulting in "no signal" on the monitor). Tested GPUs: Sapphire AMD RX 6600 (RECOMMENDED!), ZOTAC GeForce GT 710 DDR3 (<= Big Sur), Sapphire Radeon RX 570. UPDATE: Project sponsors get access to the `Private OSX-KVM repository`, and direct support. This private repository has a playbook to automate 95% of this work in a rugged, consistent manner. [Link to a list of supported GPUs](https://dortania.github.io/GPU-Buyers-Guide/modern-gpus/amd-gpu.html). ### USB passthrough notes These steps will need to be adapted for your particular setup. - Isolate the passthrough PCIe devices with vfio-pci, with the help of `lspci -nnk` command. ``` $ lspci -nnk ... 03:00.0 USB controller: ASMedia ASM1142 USB 3.1 Host Controller [1b21:1242] ``` Add `1b21:1242` to `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub` file in the required format. See `GPU passthrough notes` (above) for details. - Update initramfs, and then reboot. ``` sudo update-initramfs -k all -u ``` - Use the helper scripts to isolate the USB controller. ``` $ scripts/lsgroup.sh ### Group 7 ### 00:1c.0 PCI bridge: Intel Corporation Sunrise ... ### Group 15 ### 06:00.0 Audio device: Creative Labs Sound Core3D ... ### Group 5 ### 00:17.0 SATA controller: Intel Corporation Sunrise ... ### Group 13 ### 03:00.0 USB controller: ASMedia ASM1142 USB 3.1 Host Controller ``` ``` scripts/vfio-group.sh 13 ``` - Add `-device vfio-pci,host=03:00.0,bus=pcie.0` line to `boot-passthrough.sh`. - Boot the VM, and devices attached to the ASMedia USB controller should just work under macOS. [Here is a link to a list of recommended USB PCIe cards](http://blog.greggant.com/posts/2018/05/07/definitive-mac-pro-upgrade-guide.html). ### Synergy Notes - Get Synergy from https://sourceforge.net/projects/synergy-stable-builds. I installed "synergy-v1.8.8-stable-MacOSX-x86_64.dmg" on the macOS guest and configured it as a client. For automatically starting Synergy on macOS, add Synergy to "Login Items", System Preferences -> Users & Groups -> Select your user account -> Login Items -> Add a login item - On the Linux host machine, install "synergy-v1.8.8-stable-Linux-x86_64.deb" or newer, configure `~/.synergy.conf` and run `synergys` command. - The included `.synergy.conf` will need to be adapted according to your setup. ### Virtual Sound Device https://github.com/chris1111/VoodooHDA-OC This kext can be used on macOS 10.12 to macOS Big Sur 11.2 to get emulated sound card working. Do NOT mix VoodooHDA with AppleALC. You may want to consider HDA passthrough or USB sound card passthrough or use HDMI audio instead. Note: The emulated sound output can be choppy, and distorted. Use Sound Card / USB Sound Card passthrough instead. Note: It seems that playback of Flash videos requires an audio device to be present. ![USB Sound Card](./screenshots/QHM623_USB_Sound_Card_1.jpg) This cheap(est) USB sound card works pretty well on macOS *without* requiring USB-controller-passthrough. Since Catalina, Apple included a native virtio-sound driver, supported since QEMU 8.2. It can be enabled by adding `-device virtio-sound,audiodev=snd0 -audiodev pa,id=snd0` to the command line. libvirt support is scheduled to be added in 10.4.0, and could then be enabled like this: ```