Skip to content

How to set default boot drive to macos? OpenCore Config? #85

Open

Description

@Tyree

I want to set a physical card for the graphics card, but still run headless. With the VNC console, when the VM starts I can press enter on the proper macos drive in order to start the OS. But with no monitor, I can't do this and need this selection to be automatic or better autoselect on a timer. But I don't know how to edit OpenCore when it's in an img.

Activity

  1. tomyslo1 commented on Sep 30, 2024

    @tomyslo1

    This video should help you - even though it's Big Sur, the process should not be much different: https://youtu.be/7OunFLG84Qs?t=617
    First install MacOS without changing any VM settings, so you'll use VNC graphics. Download OpenCore Configurator and move OpenCore to your boot disk, then mount its EFI. In the Configurator, you'll set your PlatformInfo ...

    With the VNC console, when the VM starts I can press enter on the proper macos drive in order to start the OS. But with no monitor, I can't do this and need this selection to be automatic or better autoselect on a timer.

    In OpenCore Configurator: Mount your EFI > Misc > uncheck Show Picker > close & save

  2. Tyree commented on Sep 30, 2024

    @Tyree
    Author

    Thanks, @tomyslo1

    I did some further testing, though this does not affect the great instructions you just gave me...
    I passed a PCIe USB card to the VM and attached a keyboard. I did not have the graphics card passed through yet. With the VNC console pulled up, I could press enter on the keyboard to boot macos. So the USB/keyboard was working fine. That meant I should be able to boot with the graphics card enabled and press enter on the keyboard, even blind. But it would never work with the graphics card enabled.
    So I attached a monitor and restarted the VM. The graphics were piped to the monitor, so the graphics passthrough works. I could see the picker screen. But, then the keyboard wouldn't work. ???
    Very weird that the USB works fine without the graphics, but as soon as I enable the graphics, the USB stops working.
    Have you ever seen anything like that? Is it easy to fix?

    Thanks again!

  3. tomyslo1 commented on Sep 30, 2024

    @tomyslo1

    Which GPU do you have? I had a similar issue, but it was a year ago on the previous version of Macinabox. I don't remember how I fixed it, but I think it was one of the two:

    1. Either I added a vBIOS to my GPU in the VM or
    2. I had to change the bus or slot parameters of each passed-through device

    I'm not sure if this is going to benefit you, but here's my XML for my current working MacOS Sonoma VM on Unraid, with Vega 56 GPU passthrough and USB controller PCIe passthrough.

    <?xml version='1.0' encoding='UTF-8'?>
    <domain type='kvm' id='7' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
      <name>Macintosh</name>
      <uuid>a53e714d-c42d-4719-b195-4a2fc1f938dd</uuid>
      <metadata>
        <vmtemplate xmlns="unraid" name="Windows 10" icon="macos_0_radeon.png" os="osx" webui=""/>
      </metadata>
      <memory unit='KiB'>33554432</memory>
      <currentMemory unit='KiB'>33554432</currentMemory>
      <memoryBacking>
        <nosharepages/>
      </memoryBacking>
      <vcpu placement='static'>12</vcpu>
      <cputune>
        <vcpupin vcpu='0' cpuset='2'/>
        <vcpupin vcpu='1' cpuset='10'/>
        <vcpupin vcpu='2' cpuset='3'/>
        <vcpupin vcpu='3' cpuset='11'/>
        <vcpupin vcpu='4' cpuset='4'/>
        <vcpupin vcpu='5' cpuset='12'/>
        <vcpupin vcpu='6' cpuset='5'/>
        <vcpupin vcpu='7' cpuset='13'/>
        <vcpupin vcpu='8' cpuset='6'/>
        <vcpupin vcpu='9' cpuset='14'/>
        <vcpupin vcpu='10' cpuset='7'/>
        <vcpupin vcpu='11' cpuset='15'/>
      </cputune>
      <resource>
        <partition>/machine</partition>
      </resource>
      <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>/etc/libvirt/qemu/nvram/a53e714d-c42d-4719-b195-4a2fc1f938dd_VARS-pure-efi.fd</nvram>
      </os>
      <features>
        <acpi/>
        <apic/>
      </features>
      <cpu mode='host-passthrough' check='none' migratable='on'>
        <cache mode='passthrough'/>
      </cpu>
      <clock offset='utc'>
        <timer name='hpet' present='no'/>
        <timer name='hypervclock' present='no'/>
        <timer name='pit' tickpolicy='delay'/>
        <timer name='rtc' tickpolicy='catchup'/>
      </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/cache/domains/Sonoma/macos_disk.img' index='1'/>
          <backingStore/>
          <target dev='hdc' bus='sata' rotation_rate='1'/>
          <boot order='1'/>
          <alias name='sata0-0-2'/>
          <address type='drive' controller='0' bus='0' target='0' unit='2'/>
        </disk>
        <controller type='pci' index='0' model='pcie-root'>
          <alias name='pcie.0'/>
        </controller>
        <controller type='pci' index='1' model='pcie-root-port'>
          <model name='pcie-root-port'/>
          <target chassis='1' port='0x10'/>
          <alias name='pci.1'/>
          <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'/>
          <alias name='pci.2'/>
          <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'/>
          <alias name='pci.3'/>
          <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'/>
          <alias name='pci.4'/>
          <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'/>
          <alias name='pci.5'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
        </controller>
        <controller type='virtio-serial' index='0'>
          <alias name='virtio-serial0'/>
          <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
        </controller>
        <controller type='sata' index='0'>
          <alias name='ide'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
        </controller>
        <controller type='usb' index='0' model='ich9-ehci1'>
          <alias name='usb'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x7'/>
        </controller>
        <controller type='usb' index='0' model='ich9-uhci1'>
          <alias name='usb'/>
          <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'>
          <alias name='usb'/>
          <master startport='2'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x1'/>
        </controller>
        <controller type='usb' index='0' model='ich9-uhci3'>
          <alias name='usb'/>
          <master startport='4'/>
          <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x2'/>
        </controller>
        <interface type='bridge'>
          <mac address='52:54:00:85:f6:be'/>
          <source bridge='br0'/>
          <target dev='vnet6'/>
          <model type='virtio-net'/>
          <alias name='net0'/>
          <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
        </interface>
        <serial type='pty'>
          <source path='/dev/pts/1'/>
          <target type='isa-serial' port='0'>
            <model name='isa-serial'/>
          </target>
          <alias name='serial0'/>
        </serial>
        <console type='pty' tty='/dev/pts/1'>
          <source path='/dev/pts/1'/>
          <target type='serial' port='0'/>
          <alias name='serial0'/>
        </console>
        <channel type='unix'>
          <source mode='bind' path='/run/libvirt/qemu/channel/7-Macintosh/org.qemu.guest_agent.0'/>
          <target type='virtio' name='org.qemu.guest_agent.0' state='connected'/>
          <alias name='channel0'/>
          <address type='virtio-serial' controller='0' bus='0' port='1'/>
        </channel>
        <input type='mouse' bus='ps2'>
          <alias name='input0'/>
        </input>
        <input type='keyboard' bus='ps2'>
          <alias name='input1'/>
        </input>
        <audio id='1' type='none'/>
        <hostdev mode='subsystem' type='pci' managed='yes'>
          <driver name='vfio'/>
          <source>
            <address domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
          </source>
          <alias name='hostdev0'/>
          <rom file='/mnt/cache/isos/vbios/Vega56-LEFTpos.rom'/>
          <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
        </hostdev>
        <hostdev mode='subsystem' type='pci' managed='yes'>
          <driver name='vfio'/>
          <source>
            <address domain='0x0000' bus='0x03' slot='0x00' function='0x1'/>
          </source>
          <alias name='hostdev1'/>
          <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='0x04' slot='0x00' function='0x0'/>
          </source>
          <alias name='hostdev2'/>
          <address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
        </hostdev>
        <watchdog model='itco' action='reset'>
          <alias name='watchdog0'/>
        </watchdog>
        <memballoon model='none'/>
      </devices>
      <seclabel type='dynamic' model='dac' relabel='yes'>
        <label>+0:+100</label>
        <imagelabel>+0:+100</imagelabel>
      </seclabel>
      <qemu:commandline>
        <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='-usb'/>
        <qemu:arg value='-device'/>
        <qemu:arg value='usb-tablet'/>
        <qemu:arg value='-device'/>
        <qemu:arg value='usb-kbd'/>
        <qemu:arg value='-cpu'/>
        <qemu:arg value='Skylake-Server,vendor=GenuineIntel,+hypervisor,+invtsc,kvm=on,+fma,+avx,+avx2,+aes,+ssse3,+sse4_2,+popcnt,+sse4a,+bmi1,+bmi2'/>
      </qemu:commandline>
    </domain>
    
  4. Tyree commented on Sep 30, 2024

    @Tyree
    Author

    It's an older Radeon RX580 (The only AMD card I have).

    I had a mac vm running a couple years ago with this same graphics card and USB card. I couldn't get it to work with macinabox back then, but someone on the unRAID forums helped me tirelessly over PMs to get a VM going. Ran quite well for a while, but I didn't use it for much more than just the satisfaction of having what appeared to be a mac sitting on the desk. :-D
    But something borked it at some point. Suddenly wasn't putting out anything to the monitor, so I ditched it.

    When SIO updated macinabox, I decided to give it another go.

    I do remember having to mess with the bus/slot config now that you mention it. I'll have a look when I get a second and see what I can do.

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions