thenickdude / KVM-Opencore

OpenCore disk image for running macOS VMs on Proxmox/QEMU
https://www.nicksherlock.com/2021/10/installing-macos-12-monterey-on-proxmox-7/
GNU General Public License v3.0
1.3k stars 117 forks source link

Can't update from Monterey to Ventura on AMD system #42

Open ANONIMNIQ opened 2 years ago

ANONIMNIQ commented 2 years ago

I tried to update my Monterey VM to Ventura with latest Opencore release, but when I tried to boot from installer partition VM just stuck on apple logo with empty progress bar for few seconds and then reboot back to opencore menu. If I tried to boot without GPU passthrough progress bar moves a little and then reboot VM again. My CPU is Ryzen 3 2200G and my GPU is Radeon RX 470.

thenickdude commented 2 years ago

For your CPU argument, try this instead:

-cpu Haswell-noTSX,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on 

That one fixes the issue for me on AMD EPYC 7R13

NeariX67 commented 2 years ago

Can you keep us updated if it works? I was able to install and run Ventura without dGPU (Unraid passthrough, bios file provided) but it won't boot with dGPU (AMD RX 460, worked fine for Monterey)

thenickdude commented 2 years ago

@NeariX67 does your CPU have AVX2 support? If not, the AMD driver can't run

NeariX67 commented 2 years ago

10700k. It has AVX2

thenickdude commented 2 years ago

@NeariX67 share your VM config file

NeariX67 commented 2 years ago
<?xml version='1.0' encoding='UTF-8'?>
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>Macinabox Ventura</name>
<uuid>36b883f9-c5e6-4755-a04c-fe3140d73115</uuid>
<description>MacOS Ventura</description>
<metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="Ventura.png" os="osx"/>
</metadata>
<memory unit='KiB'>10485760</memory>
<currentMemory unit='KiB'>10485760</currentMemory>
<memoryBacking>
    <nosharepages/>
</memoryBacking>
<vcpu placement='static'>16</vcpu>
<cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='8'/>
    <vcpupin vcpu='2' cpuset='1'/>
    <vcpupin vcpu='3' cpuset='9'/>
    <vcpupin vcpu='4' cpuset='2'/>
    <vcpupin vcpu='5' cpuset='10'/>
    <vcpupin vcpu='6' cpuset='3'/>
    <vcpupin vcpu='7' cpuset='11'/>
    <vcpupin vcpu='8' cpuset='4'/>
    <vcpupin vcpu='9' cpuset='12'/>
    <vcpupin vcpu='10' cpuset='5'/>
    <vcpupin vcpu='11' cpuset='13'/>
    <vcpupin vcpu='12' cpuset='6'/>
    <vcpupin vcpu='13' cpuset='14'/>
    <vcpupin vcpu='14' cpuset='7'/>
    <vcpupin vcpu='15' cpuset='15'/>
</cputune>
<os>
    <type arch='x86_64' machine='pc-q35-4.2'>hvm</type>
    <loader readonly='yes' type='pflash'>/mnt/user/system/custom_ovmf/Macinabox_CODE-pure-efi.fd</loader>
    <nvram>/mnt/user/system/custom_ovmf/Macinabox_VARS-pure-efi.fd</nvram>
</os>
<features>
    <acpi/>
    <apic/>
</features>
<cpu mode='host-passthrough' check='none' migratable='on'>
    <topology sockets='1' dies='1' cores='8' threads='2'/>
    <cache mode='passthrough'/>
</cpu>
<clock offset='utc'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
</clock>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='disk'>
    <driver name='qemu' type='raw' cache='writeback'/>
    <source file='/mnt/user/domains/Macinabox Ventura/Ventura-opencore.img'/>
    <target dev='hdc' bus='sata'/>
    <boot order='1'/>
    <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <disk type='file' device='disk'>
    <driver name='qemu' type='raw' cache='writeback'/>
    <source file='/mnt/user/domains/Macinabox Ventura/macos_disk.img'/>
    <target dev='hde' bus='virtio'/>
    <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
    </disk>
    <controller type='usb' index='0' model='ich9-ehci1'>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
    <master startport='0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
    <master startport='2'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
    <master startport='4'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
    </controller>
    <controller type='sata' index='0'>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'/>
    <controller type='pci' index='1' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='1' port='0x10'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
    </controller>
    <controller type='pci' index='2' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='2' port='0x11'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x1'/>
    </controller>
    <controller type='pci' index='3' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='3' port='0x12'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x2'/>
    </controller>
    <controller type='pci' index='4' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='4' port='0x13'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x3'/>
    </controller>
    <controller type='pci' index='5' model='pcie-root-port'>
    <model name='pcie-root-port'/>
    <target chassis='5' port='0x8'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
    <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
    </controller>
    <interface type='bridge'>
    <mac address='52:54:00:08:42:4e'/>
    <source bridge='br0'/>
    <model type='virtio'/>
    <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </interface>
    <serial type='pty'>
    <target type='isa-serial' port='0'>
        <model name='isa-serial'/>
    </target>
    </serial>
    <console type='pty'>
    <target type='serial' port='0'/>
    </console>
    <channel type='unix'>
    <target type='virtio' name='org.qemu.guest_agent.0'/>
    <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <input type='tablet' bus='usb'>
    <address type='usb' bus='0' port='1'/>
    </input>
    <input type='mouse' bus='ps2'/>
    <input type='keyboard' bus='ps2'/>
    <audio id='1' type='none'/>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
    </source>
    <rom file='/mnt/user/isos/vbios/rx460v2.rom'/>
    <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
    </source>
    <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
    <source startupPolicy='optional'>
        <vendor id='0x046d'/>
        <product id='0xc32b'/>
    </source>
    <address type='usb' bus='0' port='2'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
    <source startupPolicy='optional'>
        <vendor id='0x1e7d'/>
        <product id='0x2c38'/>
    </source>
    <address type='usb' bus='0' port='3'/>
    </hostdev>
    <memballoon model='none'/>
</devices>
<qemu:commandline>
    <qemu:arg value='-usb'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='usb-kbd,bus=usb-bus.0'/>
    <qemu:arg value='-device'/>
    <qemu:arg value='isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc'/>
    <qemu:arg value='-smbios'/>
    <qemu:arg value='type=2'/>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='Cascadelake-Server,vendor=GenuineIntel,+invtsc,kvm=on,vmware-cpuid-freq=on'/>
</qemu:commandline>
</domain>
ANONIMNIQ commented 2 years ago

still don't work. boots fine to Monterey, but won't boot in Ventura installer partition. Here are my args:

args: -device isa-applesmc,osk="..." -smbios type=2 -device usb-kbd,bus=ehci.0,port=2 -cpu Haswell-noTSX,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on

btw I use Proxmox.

thenickdude commented 2 years ago

@ANONIMNIQ you're missing this arg required for passthrough devices to work on macOS on recent Q35 machine models: -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off

thenickdude commented 2 years ago

@NeariX67 the definition for your GPU audio device has the wrong address in the guest, it needs to be:

  <hostdev mode='subsystem' type='pci' managed='yes'>
    <driver name='vfio'/>
    <source>
        <address domain='0x0000' bus='0x01' slot='0x00' function='0x1'/>
    </source>
    <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x1'/>
  </hostdev>

This won't solve your issue however, it'll only fix your HDMI audio support. Not sure what's going wrong with yours.

NeariX67 commented 2 years ago

Maybe it's some issue with Lilu and Whatevergreen?

thenickdude commented 2 years ago

Can't think of one. Press cmd/win+V before selecting the boot option so you can boot in Verbose mode and see where it's going wrong.

ANONIMNIQ commented 2 years ago

still don't work. now VM can't start at all with these args:

args: -device isa-applesmc,osk="..." -smbios type=2 -device usb-kbd,bus=ehci.0,port=2 -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off -cpu Haswell-noTSX,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on

maybe I make some mistake anywhere or I need to update Proxmox?

ANONIMNIQ commented 2 years ago

@thenickdude I update my proxmox and then update to Ventura without problem with these args, Now everything worked instead of my usb keyboard. usb passthrough worked only in opencore boot menu, but when I tried to type my password to login in macos It doesn't work.

thenickdude commented 2 years ago

Is that with FileVault turned on or off? I'll test it here.

Make sure you didn't tick the USB 3 box for those devices

ANONIMNIQ commented 2 years ago

@thenickdude FileVault is off.

derritter88 commented 2 years ago

For your CPU argument, try this instead:

-cpu Haswell-noTSX,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on 

That one fixes the issue for me on AMD EPYC 7R13

I can confirm that this works also on my PVE server using AMD EPYC 7272

mbagusrd commented 2 years ago

I have the same problem with OC v19, but Im not using Proxmox, I use Linux Mint, Qemu and GPU Passthrough (RX580)