Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To someone who use KVM-Opencore on unraid to install ventura #47

Open
Bradley-Liu opened this issue Nov 12, 2022 · 12 comments
Open

To someone who use KVM-Opencore on unraid to install ventura #47

Bradley-Liu opened this issue Nov 12, 2022 · 12 comments

Comments

@Bradley-Liu
Copy link

Bradley-Liu commented Nov 12, 2022

I am writing this comment to some who use nick's kvm-opencore to install ventura.
There are several problems that encounter over the course of installing ventura.
i recommend that installation should be divided into two phases.
The first phase is to install the system via vnc without passsing through any devices.
The second phase is to passing through devices and deal with problems that may ensue.

I encouter the first problem in first phase. When I use the stock loader and nvram, when I booted opencore, I can only see one the first item in the boot menu in the middle and can't see other items like recovery and rest nvram. It's very annoying. The solution is to use loader and nvram created by spaceinvader one in his github project macinabox to replace the stock ones. You need to edit the vm xml and be sure to save the path to the stock ones.

stock(my example, your's may be different)

  <os>
    <type arch='x86_64' machine='pc-q35-4.2'>hvm</type>
    <loader readonly='yes' type='pflash'>/usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd</loader>
    <nvram>/etc/libvirt/qemu/nvram/983c9419-49b3-4619-b73b-65da10ec1462_VARS-pure-efi.fd</nvram>
  </os>

spacinvaderone( you may need to change the path)

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

The second problem is stucking at "AppleKeyStoreTest" when booting ventura for the first time after installtion.
The problem is that you maybe use the wrong cpu pramaters that is sent to the vm.

  <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='Penryn,kvm=on,vendor=GenuineIntel,+kvm_pv_unhalt,+kvm_pv_eoi,+hypervisor,+invtsc,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+avx2,+aes,+fma,+fma4,+bmi1,+bmi2,+xsave,+xsaveopt,+rdrand,check'/>
  </qemu:commandline>

The correct one, according to nick, is as follows if you are using intel. If you are using AMD, you can referrect nick's tutorial.

  <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='host,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on'/>
    <qemu:arg value='-global'/>
    <qemu:arg value='ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off'/>
    <qemu:arg value='-global'/>
    <qemu:arg value='nec-usb-xhci.msi=off'/>
  </qemu:commandline>

After installation is completed and passing through is cofigured.
I encounter the third problem which is that all the usb 1.1 (mouse,keyboard,bluetooth) devices are not working. Usb Devices like web cam are working.
The solution is setup a nec-xhci(qemu-xhci also works ) usb3.0 controller using the code below.
If you add this code through the gui interface, make sure to change port number to 7(attribute "ports"). The default generated code is "15" which is not working.

    <controller type='usb' index='0' model='nec-xhci' ports='7'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>

After using this controller , the passed through usb devices(not the usb devices connected using a passed through pci usb controllers. Passed through pci usb controllers are working out of the box if they are supported by macos ) will be working.
Here is an example:

    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x05ac'/>
        <product id='0x024f'/>
        <address bus='1' device='9'/>
      </source>
      <alias name='hostdev5'/>
      <address type='usb' bus='0' port='1'/>
    </hostdev>

If you are using usb2.0 webcam, I recommend that you add another usb2.0 controller and attached the web cam to this controller.

    <controller type='usb' index='1' model='ich9-ehci1'>
      <alias name='usb1'/>
      <address type='pci' domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
    </controller>

    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x0bda'/>
        <product id='0x58b0'/>
        <address bus='1' device='41'/>
      </source>
      <alias name='hostdev7'/>
      <address type='usb' bus='1' port='1'/>
    </hostdev>

Because if you attached the webcam to a usb3.0 controller(like the one I Created above), it may not work. You may need to adjust the bus numbers to make it valid.

I am using a usb1.1 bluetooth module which is native supported in macos. Sometime when I boot up the system, I need to close it first and open it again before in order for it function properly.

That is all the problems that I encounter along the way.

Last but not least. I need to thank nick most heartedly for his hard work and help he gave me along the way.
Without him, All this would not be possible.

I am not expert on hackintosh. But I hope this comment may save people some time when installing ventura on Unraid.

@thenickdude

@ulic75
Copy link

ulic75 commented Jan 18, 2023

Thanks for the tips. Using the new qemu:commandline options I've been able to get Ventura installed and running with VNC on unraid.

@ulic75
Copy link

ulic75 commented Jan 20, 2023

Personal experience update. After swapping the qemu:commandline sections as mentioned above, I was able to install and run on my unraid server. However, my CPU performance was pretty awful. The CPUs were running at 80% or so constantly, running time node -v took about 2.8s, where as running BigSur with the original SpaceInvaderOne commandline options it runs in 0.164s. I've switched back to BigSur for the time being and will experiment more if I have time.

@ulic75
Copy link

ulic75 commented Jan 24, 2023

Update, go things running smoothly. Here is the qemu:commandline options that work well for me.

  <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=THE-OSK-YOU-EXTRACTED-GOES-HERE'/>
    <qemu:arg value='-smbios'/>
    <qemu:arg value='type=2'/>
    <qemu:arg value='-cpu'/>
    <qemu:arg value='Cascadelake-Server,vendor=GenuineIntel,+invtsc,-pcid,-hle,-rtm,-avx512f,-avx512dq,-avx512cd,-avx512bw,-avx512vl,-avx512vnni,kvm=on,vmware-cpuid-freq=on'/>
  </qemu:commandline>

@mikeyo
Copy link

mikeyo commented Apr 5, 2023

Thanks to this guide I got Ventura 13.3 working on UNRAID 6.12 rc2 with VNC Gfx.
However, I am trying to passthrough my WX4100 but Ventura freezes at the Apple logo when booting. It does not do this with VNC Gfx. I am able to passthrough the WX4100 to a Windows 11 VM and no issues so it must be a config issue with the Ventura VM. Any ideas how I can fix this?

@thenickdude
Copy link
Owner

Make sure you have these arguments, they're required for passthrough devices to work on macOS:

<qemu:arg value='-global'/>
<qemu:arg value='ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off'/> 

@mikeyo
Copy link

mikeyo commented Apr 5, 2023

Make sure you have these arguments, they're required for passthrough devices to work on macOS:

<qemu:arg value='-global'/>
<qemu:arg value='ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off'/> 

Yep, I have this already - this is my args..

<qemu:arg value='-global'/>
<qemu:arg value='nec-usb-xhci.msi=off'/>
<qemu:arg value='-global'/>
<qemu:arg value='ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off'/>
<qemu:arg value='-cpu'/>
<qemu:arg value='Haswell-noTSX,vendor=GenuineIntel,+invtsc,+hypervisor,kvm=on,vmware-cpuid-freq=on'/>

@thenickdude
Copy link
Owner

Do you get the Tianocore boot logo on the screen at the start of guest boot? Because if not the guest UEFI is failing to init the card, so it's broken even before macOS starts loading.

@mikeyo
Copy link

mikeyo commented Apr 5, 2023

Do you get the Tianocore boot logo on the screen at the start of guest boot? Because if not the guest UEFI is failing to init the card, so it's broken even before macOS starts loading.

I get the oc boot picker, it auto selects the OS, shows the Apple logo with bar but the bar doesnt move and it just sits there.

@thenickdude
Copy link
Owner

You didn't say if the guest UEFI appears or not. macOS can't use the GPU if the guest UEFI doesn't init it. If your GPU has a broken VBIOS (e.g. one that was already used to init the card during host boot) then you get this issue.

You can press win/cmd+V at the OpenCore boot screen before picking the option to turn on Verbose Boot and see exactly where it's getting stuck.

@mikeyo
Copy link

mikeyo commented Apr 5, 2023

You didn't say if the guest UEFI appears or not. macOS can't use the GPU if the guest UEFI doesn't init it. If your GPU has a broken VBIOS (e.g. one that was already used to init the card during host boot) then you get this issue.

You can press win/cmd+V at the OpenCore boot screen before picking the option to turn on Verbose Boot and see exactly where it's getting stuck.

Im not getting the UEFI screen so maybe the issues is that. Anyways, I enabled verbose. Please see the pic at where it gets stuck. thanks.
20230405_142630

@mikeyo
Copy link

mikeyo commented Apr 5, 2023

Fixed, don't ask me what it was - possibly a buggy BIOS. Reboot and all OK.

@kelefy
Copy link

kelefy commented Oct 15, 2023

Thanks for the tips. Its greate helpful for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants