/r/VFIO

Photograph via snooOG

This is a subreddit to discuss all things related to VFIO and gaming on virtual machines in general.

NORMAL

What is VFIO?

VFIO stands for Virtual Function I/O. VFIO is a device driver that is used to assign devices to virtual machines. One of the most common uses of vfio is setting up a virtual machine with full access to a dedicated GPU. This enables near-bare-metal gaming performance in a Windows VM, offering a great alternative to dual-booting.

The Wiki

The wiki will be a one-stop shop for all things related to VFIO. Right now it has links to a small amount of resources, but it will constantly be updated.

Discord Server

To join the VFIO Discord server, click here.

Steam Group

To join the VFIO Steam group, click here.

Rules

1) No harassment

2) No shilling

3) No discussion of developing cheats

/r/VFIO

37,930 Subscribers

0

im back to try again after doing a duel boot

so i have a 4090 do i need to do a vbios patch got a working vm judt need to apply all the other stuff to it like the libvirt hook scripts all the guides i follow do not work for me

1 Comment
2024/05/17
10:43 UTC

7

Tiny11 for the vm

Windows 10 is getting out of support on oct2025 and I hate win11 for bloat and awful performance Also my pc isn't all powerful (edit:not powerful as in not a highend pc, I have only 8 gigs of ram tho which windows eats half of them) so I would like any added performance even if little

Would running tiny11 on the qemu help or it would create more problems than it solves?

edit: thanks guys for your comments, I think using win11 Iot ltsc when it comes out for the vm would be the best option instead of tiny11

Idk what to do until win11 ltsc releases officially(I want the vm for when I switch to linux I'm still on win11 home rn)but using it would be better for the long term ig

23 Comments
2024/05/16
03:39 UTC

0

how can I fix only 10 fps every game. I have tried everything pls help

4 Comments
2024/05/16
03:36 UTC

2

Clipboard Sync with NVIDIA GPU passthrough (Wayland + Win11)

I am using a muxless laptop (dGPU connected to HDMI) and passing the dGPU to Win11 guest with a Wayland Compositor (Hyprland) as host running on iGPU.

How can I share the clipboard in this scenario?

I also have a spare setup where I do not pass the dGPU and the Win11 display is running on SPICE. In that case the SPICE agent automatically synchronizes the clipboard between Wayland host and Win11 guest. But when I am passing the dGPU and using secondary monitor for Win11 (via HDMI), I cannot copy-paste between the two.

I have searched this sub, and people have recommended to use Synergy/Barrier to share mouse and keyboard, as it also have clipboard sync facility.

First of all, for keyboard and mouse I am already sharing it via evdev, so I do not need this functionality, I only want clipboard sync.

Secondly, Synergy/Barrier doesn't seem to support Wayland yet. There is also input-leap (a fork of Barrier), they are working on wayland support, and it seems like its enabled for Gnome only, but wlroots compositors like Hyprland/Sway are still not supported.

Another project waynergy, works good for Wayland compositors. But its a Synergy client, not a server. So to make it work I have to first passthrough my keyboard/mouse via evdev to guest, start a Barrier Server in Win11, and then start waynergy client in the Wayland host. This works for me, and I can have seamless cursor transition from Host <-> Guest (as compared to pressing Ctrl-Ctrl to switch via evdev), plus clipboard is also synchronized. But, I would rather prefer the host being the Server, and guest being the client instead of going through all of this circus.

Can someone share a better approach to sync clipboard for Wayland hosts?

I am aware that LookingGlass supports clipboard, but I think its useful only when I don't have a secondary monitor. Since, I have a secondary monitor (and I can't use it for Linux host anyways during passthrough as my muxless laptop doesn't allow) so I don't want to go into that route. I think they are using SPICE agent for clipboard, I wonder, if I can do something similar to achieve this, as I already have Spice agent as a fallback display adapter in the Win11.

5 Comments
2024/05/15
23:11 UTC

2

vfio-pci built-in load order

Okay, so the setup is simple: a custom kernel with (mostly) everything built-in (as opposed to built as a module), and what I'd like to do is force vfio-pci to bind to devices before the actual device drivers do.

It's pretty simple with modules where you can either depmod stuff or built-in vfio-pci so it's loaded first, but, as far as I can see, there's no depmod equivalent for built-in's. Reading this, and looking at drivers/Makefile, it seems like it's possible to just move vfio up in the build order to get it to load earlier, but this seems almost too simple. Has anyone tried this? It doesn't seem like changing the load order like that would break anything, and I'm tempted to just do it™, but I figure I'd rather ask first before my PC starts producing some magic smoke.

EDIT: So yeah, the Makefile patch does actually work, at least in terms of modifying the load order. Whether or not it has any unintended consequences, it's not immediately apparent. Not that it should, seeing how you can technically build every driver except vfio-pci as a module.

2 Comments
2024/05/15
03:04 UTC

2

Terrible disk performance on Windows 11 VM

I know this is commonly posted, but I've tried every optimization I can find and while some seem to cause marginal improvement I cannot seem to fix this.

I have intermittent (but frequent, usually multiple times per hour and lasting a few minutes on average) spikes of 100% disk usage (as reported by Windows task manager) that completely lock up my VM. Usually when this happens actual disk usage is very low, often < 1MiB/s or even < 0.5MiB/s. It seems to correlate with multiple Windows processes using the disk but I've seen it happen with as few as three simultaneous processes or as many as eight. At other times the drive can achieve speeds of >200MiB/s without problems.

The physical device is a CT2000BX500SSD1 SSD drive. Nothing fancy, but it is a decent SSD and performs as expected on tests with the host. The drive is dedicated to my Windows VM and should not otherwise be used by the host.

I am using the virtio drivers and I have a pinned iothread. I've tried a few alternate configurations described on https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Virtio_disk as well, along with an assortment of recommendations I've seen on reddit threads, forum posts, etc. What I have now is what works "best", but still not particularly well.

Please if anyone has had any similar issues or sees anything wrong with my configuration let me know.

My full libvirt configuration is below:

<domain type="kvm">
  <name>win11</name>
  <uuid>696ee705-7c0e-4449-b831-1a8adfc521bf</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/11"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit="KiB">32800768</memory>
  <currentMemory unit="KiB">32800768</currentMemory>
  <memoryBacking>
    <source type="memfd"/>
    <access mode="shared"/>
  </memoryBacking>
  <vcpu placement="static">12</vcpu>
  <iothreads>1</iothreads>
  <cputune>
    <vcpupin vcpu="0" cpuset="0"/>
    <vcpupin vcpu="1" cpuset="1"/>
    <vcpupin vcpu="2" cpuset="2"/>
    <vcpupin vcpu="3" cpuset="3"/>
    <vcpupin vcpu="4" cpuset="4"/>
    <vcpupin vcpu="5" cpuset="5"/>
    <vcpupin vcpu="6" cpuset="6"/>
    <vcpupin vcpu="7" cpuset="7"/>
    <vcpupin vcpu="8" cpuset="8"/>
    <vcpupin vcpu="9" cpuset="9"/>
    <vcpupin vcpu="10" cpuset="10"/>
    <vcpupin vcpu="11" cpuset="11"/>
    <emulatorpin cpuset="12"/>
    <iothreadpin iothread="1" cpuset="13-16"/>
  </cputune>
  <os firmware="efi">
    <type arch="x86_64" machine="pc-q35-8.2">hvm</type>
    <firmware>
      <feature enabled="no" name="enrolled-keys"/>
      <feature enabled="yes" name="secure-boot"/>
    </firmware>
    <loader readonly="yes" secure="yes" type="pflash">/usr/share/edk2/x64/OVMF_CODE.secboot.4m.fd</loader>
    <nvram template="/usr/share/edk2/x64/OVMF_VARS.4m.fd">/var/lib/libvirt/qemu/nvram/win11_VARS.fd</nvram>
    <bootmenu enable="yes"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv mode="custom">
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
      <vpindex state="on"/>
      <synic state="on"/>
      <stimer state="on">
        <direct state="on"/>
      </stimer>
      <reset state="on"/>
      <frequencies state="on"/>
      <reenlightenment state="on"/>
      <tlbflush state="on"/>
      <ipi state="on"/>
    </hyperv>
    <vmport state="off"/>
    <smm state="on"/>
    <ioapic driver="kvm"/>
  </features>
  <cpu mode="host-passthrough" check="none" migratable="on">
    <topology sockets="1" dies="1" clusters="1" cores="6" threads="2"/>
  </cpu>
  <clock offset="localtime">
    <timer name="rtc" present="no" tickpolicy="catchup"/>
    <timer name="pit" present="no" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="kvmclock" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="raw" cache="none" io="native" discard="unmap" iothread="1" queues="12"/>
      <source file="/mnt/windows/win11.img"/>
      <backingStore/>
      <target dev="vda" bus="virtio"/>
      <boot order="1"/>
      <address type="pci" domain="0x0000" bus="0x09" slot="0x00" function="0x0"/>
    </disk>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <target dev="sdb" bus="sata"/>
      <readonly/>
      <address type="drive" controller="0" bus="0" target="0" unit="1"/>
    </disk>
    <controller type="usb" index="0" model="qemu-xhci" ports="15">
      <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
    </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="0x14"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x4"/>
    </controller>
    <controller type="pci" index="6" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="6" port="0x15"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x5"/>
    </controller>
    <controller type="pci" index="7" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="7" port="0x16"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x6"/>
    </controller>
    <controller type="pci" index="8" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="8" port="0x17"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x7"/>
    </controller>
    <controller type="pci" index="9" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="9" port="0x18"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0" multifunction="on"/>
    </controller>
    <controller type="pci" index="10" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="10" port="0x19"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x1"/>
    </controller>
    <controller type="pci" index="11" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="11" port="0x1a"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x2"/>
    </controller>
    <controller type="pci" index="12" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="12" port="0x1b"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x3"/>
    </controller>
    <controller type="pci" index="13" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="13" port="0x1c"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x4"/>
    </controller>
    <controller type="pci" index="14" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="14" port="0x1d"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x5"/>
    </controller>
    <controller type="pci" index="15" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="15" port="0x8"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
    </controller>
    <controller type="pci" index="16" model="pcie-to-pci-bridge">
      <model name="pcie-pci-bridge"/>
      <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
    </controller>
    <controller type="sata" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
    </controller>
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    </controller>
    <controller type="scsi" index="0" model="lsilogic">
      <address type="pci" domain="0x0000" bus="0x10" slot="0x01" function="0x0"/>
    </controller>
    <filesystem type="mount" accessmode="passthrough">
      <driver type="virtiofs"/>
      <source dir="/var/lib/libvirt/share"/>
      <target dir="libvirt-share"/>
      <address type="pci" domain="0x0000" bus="0x0b" slot="0x00" function="0x0"/>
    </filesystem>
    <interface type="network">
      <mac address="52:54:00:a4:60:ec"/>
      <source network="default"/>
      <model type="virtio"/>
      <driver queues="8"/>
      <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>
    <input type="evdev">
      <source dev="/dev/input/by-id/usb-Logitech_USB_Optical_Mouse-event-mouse"/>
    </input>
    <input type="evdev">
      <source dev="/dev/input/by-id/usb-Telink_Wireless_Receiver-if01-event-kbd" grab="all" grabToggle="ctrl-ctrl" repeat="on"/>
    </input>
    <input type="mouse" bus="virtio">
      <address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>
    </input>
    <input type="keyboard" bus="virtio">
      <address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
    </input>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <tpm model="tpm-tis">
      <backend type="emulator" version="2.0"/>
    </tpm>
    <sound model="ich9">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>
    </sound>
    <audio id="1" type="pipewire" runtimeDir="/run/user/1000">
      <input name="qemuinput"/>
      <output name="qemuoutput"/>
    </audio>
    <hostdev mode="subsystem" type="pci" managed="yes">
      <driver name="vfio"/>
      <source>
        <address domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
      </source>
      <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="pci" managed="yes">
      <driver name="vfio"/>
      <source>
        <address domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
      </source>
      <address type="pci" domain="0x0000" bus="0x0a" slot="0x00" function="0x0"/>
    </hostdev>
    <watchdog model="itco" action="reset"/>
    <memballoon model="none"/>
  </devices>
</domain>
4 Comments
2024/05/15
02:30 UTC

1

AMD APU single gpu passthrough Error 43 on Debian host.

Hello. I have a virtual machine server using a 2400GE APU. I'm attempting to pass the APU graphics and hdmi audio to the Windows guest. The IOMMU wasn't grouped in a convenient way so we're using a kernel patched with ACSO.

The system is a headless server and is set up such that VFIO-PCI picks up the GPU and audio immediately upon booting. The UEFI boot screen for the VM doesn't come up if I plug a display into the GPU output. The APU graphics show up in the virtual machine, But with code 43 of course. I'd appreciate any help greatly. I'd like to give up, but I'm already too invested ;)

When the host boots, The display freezes on "Loading initial ramdisk". Which makes sense because the gpu is being dropped to VFIO-PCI immediately afterwards and wouldn't update anything. Starting the Virtual-Machine turns the monitor off.

I've heard of a GPU reset bug but that usually prevents you from starting the VM more than once and that's not the case. I've also heard that memballoon might cause problems so I tried disabling that too but no change. It's more likely I'm just doing it wrong.

Virtual Machine Manager:

<domain type="kvm">
  <name>Windows</name>
  <uuid>3d19709d-0788-4248-8eeb-af1309f4efc1</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/10"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit="KiB">6291456</memory>
  <currentMemory unit="KiB">6291456</currentMemory>
  <vcpu placement="static">4</vcpu>
  <os>
    <type arch="x86_64" machine="pc-q35-7.2">hvm</type>
    <loader readonly="yes" type="pflash">/usr/share/OVMF/OVMF_CODE_4M.fd</loader>
    <nvram>/var/lib/libvirt/qemu/nvram/Windows_VARS.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv mode="custom">
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
    </hyperv>
    <vmport state="off"/>
  </features>
  <cpu mode="host-passthrough" check="none" migratable="on"/>
  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="raw"/>
      <source file="/mnt/XTRA/win10.img"/>
      <target dev="sda" bus="sata"/>
      <boot order="2"/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </disk>
    <controller type="usb" index="0" model="qemu-xhci" ports="15">
      <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
    </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="0x14"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x4"/>
    </controller>
    <controller type="pci" index="6" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="6" port="0x15"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x5"/>
    </controller>
    <controller type="pci" index="7" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="7" port="0x16"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x6"/>
    </controller>
    <controller type="pci" index="8" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="8" port="0x17"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x7"/>
    </controller>
    <controller type="pci" index="9" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="9" port="0x18"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0" multifunction="on"/>
    </controller>
    <controller type="pci" index="10" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="10" port="0x19"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x1"/>
    </controller>
    <controller type="pci" index="11" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="11" port="0x1a"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x2"/>
    </controller>
    <controller type="pci" index="12" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="12" port="0x1b"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x3"/>
    </controller>
    <controller type="pci" index="13" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="13" port="0x1c"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x4"/>
    </controller>
    <controller type="pci" index="14" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="14" port="0x1d"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x5"/>
    </controller>
    <controller type="sata" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
    </controller>
    <interface type="network">
      <mac address="52:54:00:89:ef:ac"/>
      <source network="default"/>
      <model type="e1000e"/>
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </interface>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <graphics type="vnc" port="-1" autoport="yes">
      <listen type="address"/>
    </graphics>
    <audio id="1" type="none"/>
    <video>
      <model type="vga" vram="16384" heads="1" primary="yes"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
    </video>
    <hostdev mode="subsystem" type="pci" managed="yes">
      <source>
        <address domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
      </source>
      <rom file="/usr/lib/libvirt/vbios.rom"/>
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    </hostdev>
    <hostdev mode="subsystem" type="pci" managed="yes">
      <source>
        <address domain="0x0000" bus="0x04" slot="0x00" function="0x1"/>
      </source>
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </hostdev>
    <memballoon model="none"/>
  </devices>
</domain>

Kernel:

6.3.0-acso

Grub:

GRUB_CMDLINE_LINUX_DEFAULT="quiet pcie_acs_override=downstream,multifunction amd_iommu=on iommu=pt vfio-pci.ids=1002:15dd,1002:15de video=efifb:off"

Blacklisted drivers /etc/modprobe.d/blacklist.conf:

blacklist radeon
blacklist amdgpu

Device Ids in /etc/modprobe.d/vfio.conf:

options vfio-pci ids=1002:15dd,1002:15de

Adding VFIO-PCI to initramdisk /etc/initramfs-tools/modules:

vfio
vfio_pci
vfio_virqfd

IOMMU Groups with ACSO:

IOMMU Group 0:
	00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
IOMMU Group 1:
	00:01.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0] [1022:15d3]
IOMMU Group 2:
	00:01.3 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0] [1022:15d3]
IOMMU Group 3:
	00:01.4 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0] [1022:15d3]
IOMMU Group 4:
	00:08.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
IOMMU Group 5:
	00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus A [1022:15db]
IOMMU Group 6:
	00:08.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus B [1022:15dc]
IOMMU Group 7:
	00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 61)
	00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51)
IOMMU Group 8:
	00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 0 [1022:15e8]
	00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 1 [1022:15e9]
	00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 2 [1022:15ea]
	00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 3 [1022:15eb]
	00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 4 [1022:15ec]
	00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 5 [1022:15ed]
	00:18.6 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 6 [1022:15ee]
	00:18.7 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 7 [1022:15ef]
IOMMU Group 9:
	01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0e)
IOMMU Group 10:
	01:00.1 Serial controller [0700]: Realtek Semiconductor Co., Ltd. RTL8111xP UART #1 [10ec:816a] (rev 0e)
IOMMU Group 11:
	01:00.2 Serial controller [0700]: Realtek Semiconductor Co., Ltd. RTL8111xP UART #2 [10ec:816b] (rev 0e)
IOMMU Group 12:
	01:00.3 IPMI Interface [0c07]: Realtek Semiconductor Co., Ltd. RTL8111xP IPMI interface [10ec:816c] (rev 0e)
IOMMU Group 13:
	01:00.4 USB controller [0c03]: Realtek Semiconductor Co., Ltd. RTL811x EHCI host controller [10ec:816d] (rev 0e)
IOMMU Group 14:
	02:00.0 Network controller [0280]: Intel Corporation Wireless-AC 9260 [8086:2526] (rev 29)
IOMMU Group 15:
	03:00.0 Non-Volatile memory controller [0108]: Sandisk Corp WD Black SN750 / PC SN730 NVMe SSD [15b7:5006]
IOMMU Group 16:
	04:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] [1002:15dd] (rev d6)
IOMMU Group 17:
	04:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller [1002:15de]
IOMMU Group 18:
	04:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df]
IOMMU Group 19:
	04:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1 [1022:15e0]
IOMMU Group 20:
	04:00.4 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1 [1022:15e1]
IOMMU Group 21:
	04:00.5 Multimedia controller [0480]: Advanced Micro Devices, Inc. [AMD] ACP/ACP3X/ACP6x Audio Coprocessor [1022:15e2]
IOMMU Group 22:
	04:00.6 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h/19h HD Audio Controller [1022:15e3]
IOMMU Group 23:
	05:00.0 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 61)

IOMMU Groups without ACSO:

IOMMU Group 0:
	00:01.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
IOMMU Group 1:
	00:01.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0] [1022:15d3]
IOMMU Group 2:
	00:01.3 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0] [1022:15d3]
IOMMU Group 3:
	00:01.4 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 PCIe GPP Bridge [6:0] [1022:15d3]
IOMMU Group 4:
	00:08.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 00h-1fh) PCIe Dummy Host Bridge [1022:1452]
	00:08.2 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus B [1022:15dc]
	05:00.0 SATA controller [0106]: Advanced Micro Devices, Inc. [AMD] FCH SATA Controller [AHCI mode] [1022:7901] (rev 61)
IOMMU Group 5:
	00:08.1 PCI bridge [0604]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Internal PCIe GPP Bridge 0 to Bus A [1022:15db]
IOMMU Group 6:
	00:14.0 SMBus [0c05]: Advanced Micro Devices, Inc. [AMD] FCH SMBus Controller [1022:790b] (rev 61)
	00:14.3 ISA bridge [0601]: Advanced Micro Devices, Inc. [AMD] FCH LPC Bridge [1022:790e] (rev 51)
IOMMU Group 7:
	00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 0 [1022:15e8]
	00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 1 [1022:15e9]
	00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 2 [1022:15ea]
	00:18.3 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 3 [1022:15eb]
	00:18.4 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 4 [1022:15ec]
	00:18.5 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 5 [1022:15ed]
	00:18.6 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 6 [1022:15ee]
	00:18.7 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Raven/Raven2 Device 24: Function 7 [1022:15ef]
IOMMU Group 8:
	01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 0e)
	01:00.1 Serial controller [0700]: Realtek Semiconductor Co., Ltd. RTL8111xP UART #1 [10ec:816a] (rev 0e)
	01:00.2 Serial controller [0700]: Realtek Semiconductor Co., Ltd. RTL8111xP UART #2 [10ec:816b] (rev 0e)
	01:00.3 IPMI Interface [0c07]: Realtek Semiconductor Co., Ltd. RTL8111xP IPMI interface [10ec:816c] (rev 0e)
	01:00.4 USB controller [0c03]: Realtek Semiconductor Co., Ltd. RTL811x EHCI host controller [10ec:816d] (rev 0e)
IOMMU Group 9:
	02:00.0 Network controller [0280]: Intel Corporation Wireless-AC 9260 [8086:2526] (rev 29)
IOMMU Group 10:
	03:00.0 Non-Volatile memory controller [0108]: Sandisk Corp WD Black SN750 / PC SN730 NVMe SSD [15b7:5006]
IOMMU Group 11:
	04:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] [1002:15dd] (rev d6)
IOMMU Group 12:
	04:00.1 Audio device [0403]: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller [1002:15de]
	04:00.2 Encryption controller [1080]: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) Platform Security Processor [1022:15df]
	04:00.3 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1 [1022:15e0]
	04:00.4 USB controller [0c03]: Advanced Micro Devices, Inc. [AMD] Raven USB 3.1 [1022:15e1]
	04:00.5 Multimedia controller [0480]: Advanced Micro Devices, Inc. [AMD] ACP/ACP3X/ACP6x Audio Coprocessor [1022:15e2]
	04:00.6 Audio device [0403]: Advanced Micro Devices, Inc. [AMD] Family 17h/19h HD Audio Controller [1022:15e3]

https://preview.redd.it/y0rsed1w5h0d1.png?width=357&format=png&auto=webp&s=e02044edbf7f36029340cfd406853273539ba858

tried a few different versions.

1 Comment
2024/05/14
23:16 UTC

5

Motherboard Recommendation: 8x SATA, Separate iGPU and PCIe Passthroughs

I'm looking to build a new do-it-all home server.

I'm leaning towards Proxmox, passing an HBA thru to a Truenas VM, passing the Intel iGPU to a Plex container and a dedicated video card passed to a Window VM for browsing and light gaming, potentially a second card for the host.

I want the 8x SATA ports so I can fall-back to Unraid on bare metal or Proxmox managing drives and ditch the HBA card.

Any recommendations? Am I asking for too much from a motherboard?

11 Comments
2024/05/14
19:34 UTC

4

OSX-KVM single GPU passthrough

I am trying to set up a way to use my Linux normally and then on demand fire up an OSX VM with GPU passthrough.

  • Arch Linux
  • Gigabyte RX6600xt
  • macos 13 Ventura VM

I've been fucking around with it for two days, getting a bit further each time, but now I am stuck.

I can boot up the vm just fine with OpenCore-Boot.sh

Here is my script:

https://pastebin.com/McyHyMk4

What I see, the screen goes black, then I see the TianoCore boot logo, then some errors and nothing more happens. https://imgur.com/JdTkXG2

I ran info pci via telnet and it showed the GPU.

I have agdpmod=pikera in the config.plist and rebuilt the OpenCore.qcow2 according to the official instructions.

When I add a vnc option and vnc into it from another computer, I can see the proper boot menu and select an entry and boot into macos. It even seems to recognize an AMD gpu, but not fully.


Please tell me any debugging / info providing steps, as I am quite new to this.

Thank you very much for your time and effort.

2 Comments
2024/05/14
13:34 UTC

2

Single GPU passthrough

I have successfully managed to setup every hooks so that KDE session stops using my GPU and pass it to the VM. I can connect to my VM which is a windows machine via a display server and install the graphics.

But whenever I'm adding my GPU in PCIE host devices and trying to switch on the VM, it crashes and takes me to KDE SDDM.

I'm using Fedora 40

Ryzen 3 3100 (no integrated graphics)
GTX 1650 super

2 Comments
2024/05/14
12:10 UTC

2

2 GPUs, one with 3 fans, another with 2: which one on top (for the best airflow/temp)?

I am planning to build a new PC for VFIO.

I will buy a Gigabyte Gaming OC Pro 3060 Ti (2 slots, 3 fans, 281mm long, for the Windows VM) and a GUNNIR Arc A380 Photon (2 slots, 2 fans, 222mm long, for the Fedora host). I am using a standard front-intake-back-exhaust airflow case (Fractal Design Torrent Compact).

The top 2 PCIe slots (both connected to the CPU) of my motherboard bifurcates into x8/x8, so I can put either card on the topmost PCIe slot without affecting performance.

Which card would you put on the top slot (for the best temp)? Asking here because this sub probably have a lot of dual GPU users.

7 Comments
2024/05/14
08:33 UTC

5

Random restarts with GPU pass through on Windows 11 VM KVM/QEMU

I am having a problem where when I use my windows 11 vm my host system will instantly restart I can't figure out why its happening but any help would be appreciated thanks Ozzy

edit: sometimes its random and won't crash it at

VM XML: https://pastebin.com/raw/9MWydtqm
Hardware Probe https://linux-hardware.org/?probe=00d833919e

25 Comments
2024/05/13
00:47 UTC

7

Easy anti cheat

Hi guys, running a windows 10 VM using virt-manager. Passing through an rtx3060 on my asus zephyrus G14 (2021) host is Fedora 40. I can launch and play all other games that use EAC but Grayzone Warfare doesn’t even launch it just says “cannot run in a virtual machine.” Is there a way to get around this or is this straight up the future?

4 Comments
2024/05/12
22:46 UTC

2

Windows Virtual Machine won't start "shutting down, reason=failed"

I have a windows 10 virtual machine with GPU passthrough, yesterday every thing was fine, but know it doesn't start and this is what I get in a log file: "shutting down, reason=failed". I dont have any hardware that is not connected. my xml code:

<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
  <name>win10</name>
  <uuid>0baac219-b26a-4111-9d3e-b044aa666e3f</uuid>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/10"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit="KiB">13780992</memory>
  <currentMemory unit="KiB">13780992</currentMemory>
  <memoryBacking>
    <source type="memfd"/>
    <access mode="shared"/>
  </memoryBacking>
  <vcpu placement="static">4</vcpu>
  <os firmware="efi">
    <type arch="x86_64" machine="pc-q35-7.2">hvm</type>
    <firmware>
      <feature enabled="no" name="enrolled-keys"/>
      <feature enabled="no" name="secure-boot"/>
    </firmware>
    <loader readonly="yes" type="pflash">/usr/share/edk2/x64/OVMF_CODE.fd</loader>
    <nvram template="/usr/share/edk2/x64/OVMF_VARS.fd">/var/lib/libvirt/qemu/nvram/win10_VARS.fd</nvram>
    <boot dev="hd"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv mode="custom">
      <relaxed state="on"/>
      <vapic state="on"/>
      <spinlocks state="on" retries="8191"/>
      <vendor_id state="on" value="123456789123"/>
    </hyperv>
    <kvm>
      <hidden state="on"/>
    </kvm>
    <vmport state="off"/>
    <ioapic driver="kvm"/>
  </features>
  <cpu mode="host-passthrough" check="none" migratable="on">
    <topology sockets="1" dies="1" clusters="1" cores="2" threads="2"/>
  </cpu>
  <clock offset="localtime">
    <timer name="rtc" tickpolicy="catchup"/>
    <timer name="pit" tickpolicy="delay"/>
    <timer name="hpet" present="no"/>
    <timer name="hypervclock" present="yes"/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2" discard="unmap"/>
      <source file="/var/lib/libvirt/images/win10-2.qcow2"/>
      <target dev="sda" bus="sata"/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </disk>
    <controller type="usb" index="0" model="qemu-xhci" ports="15">
      <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
    </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="0x14"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x4"/>
    </controller>
    <controller type="pci" index="6" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="6" port="0x15"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x5"/>
    </controller>
    <controller type="pci" index="7" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="7" port="0x16"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x6"/>
    </controller>
    <controller type="pci" index="8" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="8" port="0x17"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x7"/>
    </controller>
    <controller type="pci" index="9" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="9" port="0x18"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0" multifunction="on"/>
    </controller>
    <controller type="pci" index="10" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="10" port="0x19"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x1"/>
    </controller>
    <controller type="pci" index="11" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="11" port="0x1a"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x2"/>
    </controller>
    <controller type="pci" index="12" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="12" port="0x1b"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x3"/>
    </controller>
    <controller type="pci" index="13" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="13" port="0x1c"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x4"/>
    </controller>
    <controller type="pci" index="14" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="14" port="0x1d"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x5"/>
    </controller>
    <controller type="pci" index="15" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="15" port="0x8"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>
    </controller>
    <controller type="pci" index="16" model="pcie-to-pci-bridge">
      <model name="pcie-pci-bridge"/>
      <address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>
    </controller>
    <controller type="sata" index="0">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>
    </controller>
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    </controller>
    <interface type="network">
      <mac address="52:54:00:b8:17:61"/>
      <source network="default"/>
      <model type="e1000e"/>
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </interface>
    <serial type="dev">
      <source path="/dev/input/event3"/>
      <target type="isa-serial" port="0">
        <model name="isa-serial"/>
      </target>
    </serial>
    <console type="dev">
      <source path="/dev/input/event3"/>
      <target type="serial" port="0"/>
    </console>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <audio id="1" type="none"/>
    <hostdev mode="subsystem" type="usb" managed="yes">
      <source>
        <vendor id="0x046d"/>
        <product id="0xc077"/>
      </source>
      <address type="usb" bus="0" port="2"/>
    </hostdev>
    <hostdev mode="subsystem" type="usb" managed="yes">
      <source>
        <vendor id="0x08bb"/>
        <product id="0x2902"/>
      </source>
      <address type="usb" bus="0" port="3"/>
    </hostdev>
    <hostdev mode="subsystem" type="pci" managed="yes">
      <source>
        <address domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
      </source>
      <rom file="/usr/share/vgabios/patched.rom"/>
      <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
    </hostdev>
    <hostdev mode="subsystem" type="pci" managed="yes">
      <source>
        <address domain="0x0000" bus="0x01" slot="0x00" function="0x1"/>
      </source>
      <address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>
    </hostdev>
    <watchdog model="itco" action="reset"/>
    <memballoon model="virtio">
      <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
    </memballoon>
  </devices>
  <qemu:commandline>
    <qemu:arg value="-object"/>
    <qemu:arg value="input-linux,id=kbd,evdev=/dev/input/event3,grab_all=on,repeat=on"/>
  </qemu:commandline>
</domain>
3 Comments
2024/05/12
18:53 UTC

3

Specifications for an "ideal" motherboard for GPU passthrough

I was trying to passthrough my GPU and there are many, many other stuff in the same IOMMU group of my GPU and the slot it is connected is the only physically viable available slot.

Then I found out about ACS override but I think there are too many vulnerability risks involved.

So what do I have to look into in a new MB specifications that would guarantee that there only my GPU (and its audio IF) will get a single IOMMU group with no other device in the same group, hence having "99%" of chances that GPU passthrough will work?

AM4 MB

Thank you

10 Comments
2024/05/12
11:05 UTC

4

Accelerated Graphics in VM-Gaming w/o a discrete GPU on Intel and AMD: what are the options?

Hi there!

I'm about to buy a new laptop. Strong contender are models with the new Intel Core Ultra 155H (6P, 8E, 2LE Cores, 4.8GHz P-Core-Turbo, 28 Watt TDP) with Intel Arc Graphics (2.25GHz) or AMDs Ryzen 7840U (8 Cores, 5.1GHz Turbo, 28 Watt TDP) with AMD Radeon 780M Graphics (2.7GHz).

I'd love to have accelerated Graphics on VM for Gaming with one of them. Which one would be the better option in this regard?

On Intel, you can make use of SR-IOV. Then you could use Looking Glass to reduce the lag you'd otherwise experience with SPICE. However, Looking Glass needs P-Cores, and the 155 Ultra only got six of them. The 7840U on the other hand has eight "real" cores that would work great with Looking Glass, the 780M iGPU doesn't support SR-IOV though. On the other hand, there has been some interesting news regarding the virtualization of GPUs on Qemu/KVM, see here: Virtio GPU Venus Resident Evil

Which CPU would you prefer, and why?

9 Comments
2024/05/12
08:52 UTC

6

Trouble getting Win 11 VM running with 13th gen.

0

Hello all. I am here in hopes I can find an answer to an issue I have been experiencing with trying to get my Windows 11 VM running on KVM with my new Intel 13900KS. To be specific, this virtual machine setup was working just fine with a 11900K before a hardware upgrade.

My setup for the VM is by passing through an Nvidia GPU to the VM along with an NVME SSD with Windows installed on it and my games. I am using virt-manager (KVM) on Arch Linux and have all the latest packages. I also utilize looking glass for seeing and interacting with the VM.

Now the problem I am currently having is with a very similar configuration, the VM will start for a second and then proceed to crash. After some testing, I found the line in the XML causing the issue is

<shmem name="looking-glass">
  <model type="ivshmem-plain"/
  <size unit="M">64</size>
  <address type="pci" domain="0x0000" bus="0x10" slot="0x01" function="0x0"/>
</shmem>

When this line is removed I have no problem running the VM, however, without it, looking glass will not work as it is required.

I have reached out to the KVM community within Discord twice now regarding this issue, however, no one there has been able to help me. It was suggested to add

<maxphysaddr mode='emulate'/> 

to the <CPU> within the config. This unfortunately did not work for me. When added, the VM will start without crashing but then fails to post. The looking glass displays the message "Guest has not initialized the display (yet)." and the CPU monitor will reflect no CPU usage as it remains as a flat line.

I would like to mention that I have followed the AcrWiki guide to PCI Passthrough via OVMF and the looking glass documentation ver closely so it was set up correctly. This would reflect with the VM working without the shmem line within the config.

I have reviewed the KVM logs, dmesg and even journalctl and the evidence points to the CPU being the issue for some reason. I have played with settings in BIOS like having XMP enabled, XMP disabled and even tried the new "intel baseline defaults" profile thinking it may be a stability issue. I made sure the VT-d was enabled, IOMMU setting was enabled and even removed two RAM sticks. All the same results. I am just at a complete loss and now considering trading this CPU in for 14900K to see if that would yield the results I am looking for.

I am not sure what would be the most appropriate method of attaching the logs to this post so I will utilize pastebin and link them below for you to see. I also included my KVM XML in case that is requested.

  1. lirtlog without phyaddress
  2. virtlog with phyaddress
  3. KVM XML

I really would appreciate any help that anyone can offer. Thank you for your time!

0 Comments
2024/05/12
04:32 UTC

2

Routing VM's internet connection through another VM's VPN connection?

Similar to Whonix, I want to create two virtual machines in my libvirt installation, one being VM 1, and the other being VM 2. VM 1 has two virtual network adapters attached, one providing the host's internet, and the other outputting the internet connection that the VPN software running in VM 1 provides, with VM 2 ONLY having access (hence having the second virtual network adapter of VM 1 shared with VM 2) to the internet through this VPN internet, and only when the VPN is working.

As this may be all too confusing, I designed a little infographic:

Routing VPN traffic from a router VM (running Debian) to a Windows VM.

Is this possible? If so, how do I create the two virtual network adapters for this, and how do I configure the two from outside and inside the VMs?

I only have experience with very basic TCP socket programming, and am nowhere near good at network configuration stuff, such as DHCP, or custom IP configurations. The reason why I want to do this over Whonix, is because of the much faster speeds that VPNs provide, and the potential higher anonymity that they provide (such as the two VPNs I mentioned in the image above).

1 Comment
2024/05/11
18:18 UTC

2

What is my next troubleshooting step?

So, I've had a working W11 VM with gpu passthrough on this machine before.

Got my W11 vm set up, everything works fine up to the point of adding my gpu/gpu audio to the vm. After that, everytime I boot I either get BSOD saying "System Thread Exception Not Handled", or I get the W11 login screen and shortly after it freezes with black screen.

Found/implemented this solution, didn't work:
sudo nano /etc/modprobe.d/kvm.conf
add "options kvm ignore_msrs=1"
reboot

Same result.

Here is my XML:

<domain type="kvm">

<name>win11</name>

<uuid>cc2058c1-f714-49af-8658-29fb7c266b5a</uuid>

<metadata>

<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">

<libosinfo:os id="http://microsoft.com/win/11"/>

</libosinfo:libosinfo>

</metadata>

<memory unit="KiB">33554432</memory>

<currentMemory unit="KiB">33554432</currentMemory>

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

<os firmware="efi">

<type arch="x86\\\\\\\_64" machine="pc-q35-9.0">hvm</type>

<firmware>

<feature enabled="no" name="enrolled-keys"/>

<feature enabled="yes" name="secure-boot"/>

</firmware>

<loader readonly="yes" secure="yes" type="pflash">/usr/share/edk2/x64/OVMF_CODE.secboot.fd</loader>

<nvram template="/usr/share/edk2/x64/OVMF\\\\\\\_VARS.fd">/var/lib/libvirt/qemu/nvram/win11_VARS.fd</nvram>

</os>

<features>

<acpi/>

<apic/>

<hyperv mode="custom">

<relaxed state="on"/>

<vapic state="on"/>

<spinlocks state="on" retries="8191"/>

</hyperv>

<vmport state="off"/>

<smm state="on"/>

<ioapic driver="kvm"/>

</features>

<cpu mode="host-passthrough" check="none" migratable="on">

<topology sockets="1" dies="1" clusters="1" cores="6" threads="2"/>

<feature policy="require" name="topoext"/>

</cpu>

<clock offset="localtime">

<timer name="rtc" tickpolicy="catchup"/>

<timer name="pit" tickpolicy="delay"/>

<timer name="hpet" present="no"/>

<timer name="hypervclock" present="yes"/>

</clock>

<on_poweroff>destroy</on_poweroff>

<on_reboot>restart</on_reboot>

<on_crash>destroy</on_crash>

<pm>

<suspend-to-mem enabled="no"/>

<suspend-to-disk enabled="no"/>

</pm>

<devices>

<emulator>/usr/bin/qemu-system-x86_64</emulator>

<disk type="file" device="disk">

<driver name="qemu" type="qcow2"/>

<source file="/var/lib/libvirt/images/win11.qcow2"/>

<target dev="vda" bus="virtio"/>

<boot order="1"/>

<address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>

</disk>

<disk type="block" device="disk">

<driver name="qemu" type="raw" cache="none" io="native" discard="unmap"/>

<source dev="/dev/disk/by-id/nvme-SPCC\\\\\\\_M.2\\\\\\\_PCIe\\\\\\\_SSD\\\\\\\_7E9607271BBE00202560"/>

<target dev="vdb" bus="virtio"/>

<address type="pci" domain="0x0000" bus="0x0a" slot="0x00" function="0x0"/>

</disk>

<disk type="block" device="disk">

<driver name="qemu" type="raw" cache="none" io="native" discard="unmap"/>

<source dev="/dev/disk/by-id/ata-JAJS600M2TB\\\\\\\_AB202200000031002214"/>

<target dev="vdc" bus="virtio"/>

<address type="pci" domain="0x0000" bus="0x0b" slot="0x00" function="0x0"/>

</disk>

<disk type="file" device="cdrom">

<driver name="qemu" type="raw"/>

<source file="/home/olorin12/Downloads/Win11\\\\\\\_23H2\\\\\\\_EnglishInternational\\\\\\\_x64v2.iso"/>

<target dev="sdb" bus="sata"/>

<readonly/>

<address type="drive" controller="0" bus="0" target="0" unit="1"/>

</disk>

<disk type="file" device="cdrom">

<driver name="qemu" type="raw"/>

<source file="/home/olorin12/Downloads/virtio-win-0.1.240.iso"/>

<target dev="sdc" bus="sata"/>

<readonly/>

<address type="drive" controller="0" bus="0" target="0" unit="2"/>

</disk>

<controller type="usb" index="0" model="qemu-xhci" ports="15">

<address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>

</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="0x14"/>

<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x4"/>

</controller>

<controller type="pci" index="6" model="pcie-root-port">

<model name="pcie-root-port"/>

<target chassis="6" port="0x15"/>

<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x5"/>

</controller>

<controller type="pci" index="7" model="pcie-root-port">

<model name="pcie-root-port"/>

<target chassis="7" port="0x16"/>

<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x6"/>

</controller>

<controller type="pci" index="8" model="pcie-root-port">

<model name="pcie-root-port"/>

<target chassis="8" port="0x17"/>

<address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x7"/>

</controller>

<controller type="pci" index="9" model="pcie-root-port">

<model name="pcie-root-port"/>

<target chassis="9" port="0x18"/>

<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x0" multifunction="on"/>

</controller>

<controller type="pci" index="10" model="pcie-root-port">

<model name="pcie-root-port"/>

<target chassis="10" port="0x19"/>

<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x1"/>

</controller>

<controller type="pci" index="11" model="pcie-root-port">

<model name="pcie-root-port"/>

<target chassis="11" port="0x1a"/>

<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x2"/>

</controller>

<controller type="pci" index="12" model="pcie-root-port">

<model name="pcie-root-port"/>

<target chassis="12" port="0x1b"/>

<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x3"/>

</controller>

<controller type="pci" index="13" model="pcie-root-port">

<model name="pcie-root-port"/>

<target chassis="13" port="0x1c"/>

<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x4"/>

</controller>

<controller type="pci" index="14" model="pcie-root-port">

<model name="pcie-root-port"/>

<target chassis="14" port="0x1d"/>

<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x5"/>

</controller>

<controller type="pci" index="15" model="pcie-root-port">

<model name="pcie-root-port"/>

<target chassis="15" port="0x1e"/>

<address type="pci" domain="0x0000" bus="0x00" slot="0x03" function="0x6"/>

</controller>

<controller type="pci" index="16" model="pcie-to-pci-bridge">

<model name="pcie-pci-bridge"/>

<address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>

</controller>

<controller type="sata" index="0">

<address type="pci" domain="0x0000" bus="0x00" slot="0x1f" function="0x2"/>

</controller>

<controller type="virtio-serial" index="0">

<address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>

</controller>

<interface type="bridge">

<mac address="52:54:00:a4:e5:f4"/>

<source bridge="virbr0"/>

<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="spicevmc">

<target type="virtio" name="com.redhat.spice.0"/>

<address type="virtio-serial" controller="0" bus="0" port="1"/>

</channel>

<input type="mouse" bus="ps2"/>

<input type="keyboard" bus="ps2"/>

<input type="mouse" bus="virtio">

<address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>

</input>

<input type="keyboard" bus="virtio">

<address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>

</input>

<tpm model="tpm-crb">

<backend type="emulator" version="2.0"/>

</tpm>

<graphics type="spice" autoport="yes">

<listen type="address"/>

<image compression="off"/>

</graphics>

<sound model="ich9">

<audio id="1"/>

<address type="pci" domain="0x0000" bus="0x00" slot="0x1b" function="0x0"/>

</sound>

<audio id="1" type="spice"/>

<video>

<model type="vga" vram="16384" heads="1" primary="yes"/>

<address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0"/>

</video>

<hostdev mode="subsystem" type="pci" managed="yes">

<source>

<address domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>

</source>

<address type="pci" domain="0x0000" bus="0x08" slot="0x00" function="0x0"/>

</hostdev>

<hostdev mode="subsystem" type="pci" managed="yes">

<source>

<address domain="0x0000" bus="0x03" slot="0x00" function="0x1"/>

</source>

<address type="pci" domain="0x0000" bus="0x09" slot="0x00" function="0x0"/>

</hostdev>

<redirdev bus="usb" type="spicevmc">

<address type="usb" bus="0" port="2"/>

</redirdev>

<redirdev bus="usb" type="spicevmc">

<address type="usb" bus="0" port="3"/>

</redirdev>

<watchdog model="itco" action="reset"/>

<memballoon model="none"/>

<shmem name="looking-glass">

<model type="ivshmem-plain"/>

<size unit="M">32</size>

<address type="pci" domain="0x0000" bus="0x10" slot="0x01" function="0x0"/>

</shmem>

</devices>

</domain>

What should be my next troubleshooting step? Thanks!

1 Comment
2024/05/11
08:39 UTC

2

All AMD/Dual GPU Laptop GPU Passthrough

Hi there, I recently purchased a Lenovo Thinkbook Z16 Gen 2, with an Ryzen 9 w/ integrated graphics, as well as a RX 6550M. I'm running Ubuntu (23.10 atm, but might switch to 22.4.x until 24.4.1 drops), and would like to setup a Windows 10 VM (using libvirt/virt-manager) for gaming, passing through the 6550M if possible. I've done single GPU passthrough on a desktop before, but as I understand (please correct me if I'm wrong) it's a bit different with a dual GPU laptop. It also seems I may have issues blacklisting the GPU drivers since they're all AMD. What is the recommended setup for this? I've heard about looking glass, but don't really know if it's applicable to my setup. Any advice/ideas would be greatly appreciated!

1 Comment
2024/05/11
01:33 UTC

4

Virtio-fs Unable to execute applications but can copy fine.

I have this storage drive mounted through the virtio-fs system, it shows up and I can copy to and from it but it won't execute programs correctly.

Spits out random errors depending on exe/app ran. I've never seen this before and don't really know whats going on. The permissions should be set correctly on the HOST, but I don't know if that would be the issue?

Apps will attempt to run, its just they error out with random reasons.

Anyone had this before?

2 Comments
2024/05/10
14:10 UTC

3

OSX-KVM: OpenCore-Boot.sh works but Virt-Manager hangs on PCI Configuration Begin

Hey guys,

As the title says, the CLI script for OpenCore seems to work on my machine out of the box, however I want to push over my Mac VM to virtmanager to make it easier attaching my single GPU to passthrough.

I've been following these guides so far:

https://gitlab.com/risingprismtv/single-gpu-passthrough/-/wikis/

https://github.com/kholia/OSX-KVM

I can install and run Mac OS just fine in CLI, it's just virtmanager that hangs. I was able to get a screenshot near before it stopped (the startup runs at the speed of light and then quits out, really hard to time):

https://preview.redd.it/0wnqehtpnhzc1.png?width=677&format=png&auto=webp&s=574773e9f06f7c41d52b3637d2e8e3e7434d0822

Right after the couldn't alloc class, there's the PCI configuration begin and it immediately shuts off.

Catted libvirt logs and I'm getting a domain is tainted error, not sure if related:

  </qemu:commandline>
---------------------^
2024-05-09 21:35:19.860+0000: 4337: warning : qemuDomainObjTaintMsg:7056 : Domain id=2 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 21:35:20.044+0000: 5758: error : qemuMonitorIORead:396 : Unable to read from monitor: Connection reset by peer
2024-05-09 21:35:20.045+0000: 5758: error : qemuProcessReportLogError:1926 : internal error: QEMU unexpectedly closed the monitor (vm='macOS'): 2024-05-09T21:35:19.951824Z qemu-system-x86_64: npci=0x3000: Could not open 'npci=0x3000': No such file or directory
2024-05-09 21:35:20.045+0000: 4337: error : qemuProcessReportLogError:1926 : internal error: process exited while connecting to monitor: 2024-05-09T21:35:19.951824Z qemu-system-x86_64: npci=0x3000: Could not open 'npci=0x3000': No such file or directory
2024-05-09 21:35:28.297+0000: 4341: warning : qemuDomainObjTaintMsg:7056 : Domain id=3 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 21:35:28.471+0000: 5801: error : qemuMonitorIORead:396 : Unable to read from monitor: Connection reset by peer
2024-05-09 21:35:28.471+0000: 5801: error : qemuProcessReportLogError:1926 : internal error: QEMU unexpectedly closed the monitor (vm='macOS'): 2024-05-09T21:35:28.392915Z qemu-system-x86_64: npci=0x2000: Could not open 'npci=0x2000': No such file or directory
2024-05-09 21:53:25.574+0000: 4339: warning : qemuDomainObjTaintMsg:7056 : Domain id=4 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 21:53:25.724+0000: 7213: error : qemuMonitorIORead:396 : Unable to read from monitor: Connection reset by peer
2024-05-09 21:53:25.725+0000: 7213: error : qemuProcessReportLogError:1926 : internal error: QEMU unexpectedly closed the monitor (vm='macOS'): 2024-05-09T21:53:25.671643Z qemu-system-x86_64: -device {"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}: PCI: slot 1 function 0 not available for pcie-root-port, in use by qemu-xhci,id=xhci
2024-05-09 21:54:55.704+0000: 4339: warning : qemuDomainObjTaintMsg:7056 : Domain id=5 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 21:55:10.568+0000: 4337: warning : qemuDomainObjTaintMsg:7056 : Domain id=6 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 21:55:49.891+0000: 4341: warning : qemuDomainObjTaintMsg:7056 : Domain id=7 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 21:56:35.007+0000: 4339: warning : qemuDomainObjTaintMsg:7056 : Domain id=8 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 21:57:31.199+0000: 4340: warning : qemuDomainObjTaintMsg:7056 : Domain id=9 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 21:59:18.479+0000: 4341: warning : qemuDomainObjTaintMsg:7056 : Domain id=10 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 21:59:18.647+0000: 8110: error : qemuMonitorIORead:396 : Unable to read from monitor: Connection reset by peer
2024-05-09 21:59:18.648+0000: 8110: error : qemuProcessReportLogError:1926 : internal error: QEMU unexpectedly closed the monitor (vm='macOS'): 2024-05-09T21:59:18.577246Z qemu-system-x86_64: -device {"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}: PCI: slot 1 function 0 not available for pcie-root-port, in use by usb-ehci,id=xhci
2024-05-09 22:01:25.211+0000: 4339: warning : qemuDomainObjTaintMsg:7056 : Domain id=11 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 22:01:25.371+0000: 8189: error : qemuMonitorIORead:396 : Unable to read from monitor: Connection reset by peer
2024-05-09 22:01:25.371+0000: 8189: error : qemuProcessReportLogError:1926 : internal error: QEMU unexpectedly closed the monitor (vm='macOS'): 2024-05-09T22:01:25.296271Z qemu-system-x86_64: -device hda-duplex: no default audio driver available
Perhaps you wanted to use -audio or set audiodev=audio1?
2024-05-09 22:01:48.409+0000: 4341: warning : qemuDomainObjTaintMsg:7056 : Domain id=12 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 22:01:48.594+0000: 8245: error : qemuMonitorIORead:396 : Unable to read from monitor: Connection reset by peer
2024-05-09 22:01:48.594+0000: 8245: error : qemuProcessReportLogError:1926 : internal error: QEMU unexpectedly closed the monitor (vm='macOS'): qemu-system-x86_64: -audio hda-duplex: Parameter 'driver' does not accept value 'hda-duplex'
2024-05-09 22:01:48.594+0000: 4341: error : qemuProcessReportLogError:1926 : internal error: process exited while connecting to monitor: qemu-system-x86_64: -audio hda-duplex: Parameter 'driver' does not accept value 'hda-duplex'
2024-05-09 22:02:01.585+0000: 4338: warning : qemuDomainObjTaintMsg:7056 : Domain id=13 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 22:02:01.801+0000: 8291: error : qemuMonitorIORead:396 : Unable to read from monitor: Connection reset by peer
2024-05-09 22:02:01.801+0000: 8291: error : qemuProcessReportLogError:1926 : internal error: QEMU unexpectedly closed the monitor (vm='macOS'): 2024-05-09T22:02:01.695822Z qemu-system-x86_64: -device {"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}: PCI: slot 1 function 0 not available for pcie-root-port, in use by ich9-intel-hda,id=(null)
2024-05-09 22:02:19.452+0000: 4341: warning : qemuDomainObjTaintMsg:7056 : Domain id=14 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 22:02:41.341+0000: 4341: warning : qemuDomainObjTaintMsg:7056 : Domain id=15 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 22:03:03.981+0000: 4338: warning : qemuDomainObjTaintMsg:7056 : Domain id=16 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv
2024-05-09 23:45:58.510+0000: 4135: info : libvirt version: 10.3.0
2024-05-09 23:45:58.510+0000: 4135: info : hostname: archlinux
2024-05-09 23:45:58.510+0000: 4135: warning : qemuDomainObjTaintMsg:7056 : Domain id=1 name='macOS' uuid=2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 is tainted: custom-argv

Catted my macos.log:

/usr/bin/qemu-system-x86_64 \
-name guest=macOS,debug-threads=on \
-S \
-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain-1-macOS/master-key.aes"}' \
-blockdev '{"driver":"file","filename":"/home/scryv/OSX-KVM/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \
-blockdev '{"driver":"file","filename":"/home/scryv/OSX-KVM/OVMF_VARS.fd","node-name":"libvirt-pflash1-storage","read-only":false}' \
-machine pc-q35-4.2,usb=off,dump-guest-core=off,memory-backend=pc.ram,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-storage,hpet=off,acpi=on \
-accel kvm \
-cpu qemu64 \
-m size=4194304k \
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":4294967296}' \
-overcommit mem-lock=off \
-smp 4,sockets=4,cores=1,threads=1 \
-uuid 2aca0dd6-cec9-4717-9ab2-0b7b13d111c3 \
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,fd=33,server=on,wait=off \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=utc,driftfix=slew \
-global kvm-pit.lost_tick_policy=delay \
-no-shutdown \
-boot strict=on \
-device '{"driver":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \
-device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \
-device '{"driver":"pcie-root-port","port":10,"chassis":3,"id":"pci.3","bus":"pcie.0","addr":"0x1.0x2"}' \
-device '{"driver":"pcie-root-port","port":11,"chassis":4,"id":"pci.4","bus":"pcie.0","addr":"0x1.0x3"}' \
-device '{"driver":"pcie-root-port","port":12,"chassis":5,"id":"pci.5","bus":"pcie.0","addr":"0x1.0x4"}' \
-device '{"driver":"pcie-root-port","port":13,"chassis":6,"id":"pci.6","bus":"pcie.0","addr":"0x1.0x5"}' \
-device '{"driver":"pcie-root-port","port":14,"chassis":7,"id":"pci.7","bus":"pcie.0","addr":"0x1.0x6"}' \
-device '{"driver":"pcie-root-port","port":15,"chassis":8,"id":"pci.8","bus":"pcie.0","addr":"0x1.0x7"}' \
-device '{"driver":"pcie-pci-bridge","id":"pci.9","bus":"pci.3","addr":"0x0"}' \
-device '{"driver":"ich9-usb-ehci1","id":"usb","bus":"pcie.0","addr":"0x7.0x7"}' \
-device '{"driver":"ich9-usb-uhci1","masterbus":"usb.0","firstport":0,"bus":"pcie.0","multifunction":true,"addr":"0x7"}' \
-device '{"driver":"ich9-usb-uhci2","masterbus":"usb.0","firstport":2,"bus":"pcie.0","addr":"0x7.0x1"}' \
-device '{"driver":"ich9-usb-uhci3","masterbus":"usb.0","firstport":4,"bus":"pcie.0","addr":"0x7.0x2"}' \
-device '{"driver":"virtio-serial-pci","id":"virtio-serial0","bus":"pci.2","addr":"0x0"}' \
-blockdev '{"driver":"file","filename":"/home/scryv/OSX-KVM/OpenCore/OpenCore.qcow2","aio":"threads","node-name":"libvirt-3-storage","auto-read-only":true,"discard":"unmap","cache":{"direct":false,"no-flush":false}}' \
-blockdev '{"node-name":"libvirt-3-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"qcow2","file":"libvirt-3-storage","backing":null}' \
-device '{"driver":"ide-hd","bus":"ide.0","drive":"libvirt-3-format","id":"sata0-0-0","bootindex":2,"write-cache":"on"}' \
-blockdev '{"driver":"file","filename":"/home/scryv/OSX-KVM/mac_hdd_ng.img","aio":"threads","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","cache":{"direct":false,"no-flush":false}}' \
-blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"direct":false,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage","backing":null}' \
-device '{"driver":"ide-hd","bus":"ide.1","drive":"libvirt-2-format","id":"sata0-0-1","bootindex":1,"write-cache":"on"}' \
-blockdev '{"driver":"file","filename":"/home/scryv/OSX-KVM/BaseSystem.img","node-name":"libvirt-1-storage","read-only":false,"cache":{"direct":false,"no-flush":false}}' \
-device '{"driver":"ide-hd","bus":"ide.2","drive":"libvirt-1-storage","id":"sata0-0-2","bootindex":3,"write-cache":"on"}' \
-netdev '{"type":"tap","fd":"34","id":"hostnet0"}' \
-device '{"driver":"vmxnet3","netdev":"hostnet0","id":"net0","mac":"52:54:00:e6:85:40","bus":"pci.9","addr":"0x1"}' \
-chardev pty,id=charserial0 \
-device '{"driver":"isa-serial","chardev":"charserial0","id":"serial0","index":0}' \
-chardev socket,id=charchannel0,fd=32,server=on,wait=off \
-device '{"driver":"virtserialport","bus":"virtio-serial0.0","nr":1,"chardev":"charchannel0","id":"channel0","name":"org.qemu.guest_agent.0"}' \
-audiodev '{"id":"audio1","driver":"spice"}' \
-spice port=5900,addr=127.0.0.1,disable-ticketing=on,seamless-migration=on \
-device '{"driver":"virtio-vga","id":"video0","max_outputs":1,"bus":"pci.1","addr":"0x0"}' \
-global ICH9-LPC.noreboot=off \
-watchdog-action reset \
-chardev spicevmc,id=charredir0,name=usbredir \
-device '{"driver":"usb-redir","chardev":"charredir0","id":"redir0","bus":"usb.0","port":"1"}' \
-device 'isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc' \
-smbios type=2 \
-usb \
-device usb-tablet \
-device usb-kbd \
-cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
2024-05-09 23:45:58.510+0000: Domain id=1 is tainted: custom-argv
char device redirected to /dev/pts/1 (label charserial0)
2024-05-09 23:46:10.040+0000: shutting down, reason=crashed

My virtmanager config does not currently have my GPU passed through yet, but I did try that the other day and got the same result:

https://preview.redd.it/08az74s1phzc1.png?width=927&format=png&auto=webp&s=5205080a54fae57809cc8e398741602668d08d8f

XML file:

<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
  <name>macOS</name>
  <uuid>2aca0dd6-cec9-4717-9ab2-0b7b13d111c3</uuid>
  <title>macOS</title>
  <memory unit="KiB">4194304</memory>
  <currentMemory unit="KiB">4194304</currentMemory>
  <vcpu placement="static">4</vcpu>
  <os>
    <type arch="x86_64" machine="pc-q35-4.2">hvm</type>
    <loader readonly="yes" type="pflash">/home/scryv/OSX-KVM/OVMF_CODE.fd</loader>
    <nvram>/home/scryv/OSX-KVM/OVMF_VARS.fd</nvram>
  </os>
  <features>
    <acpi/>
    <apic/>
  </features>
  <cpu mode="custom" match="exact" check="none">
    <model fallback="forbid">qemu64</model>
  </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/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2" cache="writeback" io="threads"/>
      <source file="/home/scryv/OSX-KVM/OpenCore/OpenCore.qcow2"/>
      <target dev="sda" bus="sata"/>
      <boot order="2"/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </disk>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2" cache="writeback" io="threads"/>
      <source file="/home/scryv/OSX-KVM/mac_hdd_ng.img"/>
      <target dev="sdb" bus="sata"/>
      <boot order="1"/>
      <address type="drive" controller="0" bus="0" target="0" unit="1"/>
    </disk>
    <disk type="file" device="disk">
      <driver name="qemu" type="raw" cache="writeback"/>
      <source file="/home/scryv/OSX-KVM/BaseSystem.img"/>
      <target dev="sdc" bus="sata"/>
      <boot order="3"/>
      <address type="drive" controller="0" bus="0" target="0" unit="2"/>
    </disk>
    <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="0x8"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0" multifunction="on"/>
    </controller>
    <controller type="pci" index="2" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="2" port="0x9"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x1"/>
    </controller>
    <controller type="pci" index="3" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="3" port="0xa"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x2"/>
    </controller>
    <controller type="pci" index="4" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="4" port="0xb"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x3"/>
    </controller>
    <controller type="pci" index="5" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="5" port="0xc"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x4"/>
    </controller>
    <controller type="pci" index="6" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="6" port="0xd"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x5"/>
    </controller>
    <controller type="pci" index="7" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="7" port="0xe"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x6"/>
    </controller>
    <controller type="pci" index="8" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="8" port="0xf"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x7"/>
    </controller>
    <controller type="pci" index="9" model="pcie-to-pci-bridge">
      <model name="pcie-pci-bridge"/>
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    </controller>
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
    </controller>
    <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>
    <interface type="bridge">
      <mac address="52:54:00:e6:85:40"/>
      <source bridge="virbr0"/>
      <model type="vmxnet3"/>
      <address type="pci" domain="0x0000" bus="0x09" slot="0x01" 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="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <graphics type="spice" autoport="yes">
      <listen type="address"/>
    </graphics>
    <audio id="1" type="spice"/>
    <video>
      <model type="virtio" heads="1" primary="yes"/>
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </video>
    <redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="1"/>
    </redirdev>
    <watchdog model="itco" action="reset"/>
    <memballoon model="none"/>
  </devices>
  <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="Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,check"/>
  </qemu:commandline>
</domain>

Args that are sent via OpenCore-Boot.sh:

args=(
  -enable-kvm -m "$ALLOCATED_RAM" -cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,vmware-cpuid-freq=on,"$MY_OPTIONS"
  -machine q35
  -device qemu-xhci,id=xhci
  -device usb-kbd,bus=xhci.0 -device usb-tablet,bus=xhci.0
  -smp "$CPU_THREADS",cores="$CPU_CORES",sockets="$CPU_SOCKETS"
  -device usb-ehci,id=ehci
  # -device usb-kbd,bus=ehci.0
  # -device usb-mouse,bus=ehci.0
  # -device nec-usb-xhci,id=xhci
  # -global nec-usb-xhci.msi=off
  # -global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=off
  # -device usb-host,vendorid=0x8086,productid=0x0808  # 2 USD USB Sound Card
  # -device usb-host,vendorid=0x1b3f,productid=0x2008  # Another 2 USD USB Sound Card
  -device isa-applesmc,osk="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
  -drive if=pflash,format=raw,readonly=on,file="$REPO_PATH/$OVMF_DIR/OVMF_CODE.fd"
  -drive if=pflash,format=raw,file="$REPO_PATH/$OVMF_DIR/OVMF_VARS-1920x1080.fd"
  -smbios type=2
  -device ich9-intel-hda -device hda-duplex
  -device ich9-ahci,id=sata
  -drive id=OpenCoreBoot,if=none,snapshot=on,format=qcow2,file="$REPO_PATH/OpenCore/OpenCore.qcow2"
  -device ide-hd,bus=sata.2,drive=OpenCoreBoot
  -device ide-hd,bus=sata.3,drive=InstallMedia
  -drive id=InstallMedia,if=none,file="$REPO_PATH/BaseSystem.img",format=raw
  -drive id=MacHDD,if=none,file="$REPO_PATH/mac_hdd_ng.img",format=qcow2
  -device ide-hd,bus=sata.4,drive=MacHDD
  # -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:27
  -netdev user,id=net0,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=net0,id=net0,mac=52:54:00:c9:18:27
  # -netdev user,id=net0 -device vmxnet3,netdev=net0,id=net0,mac=52:54:00:c9:18:27  # Note: Use this line for High Sierra
  -monitor stdio
  -device vmware-svga
  # -spice port=5900,addr=127.0.0.1,disable-ticketing=on

EDIT: Hey everyone, bit of an update.

Decided to pass through all arguments from the OpenCore-Boot.sh script into my libvirtxml file, and it seemed to work. I'm now running into a new problem, there's a mouse and keyboard error at the end of booting:

https://preview.redd.it/txzp89d7gmzc1.png?width=795&format=png&auto=webp&s=6481d01bd1ae87fddbf63738b09dfe45c29b7a64

Tried plugging in another mouse and it didnt seem to work, I have a razer naga pro and a logitech hero mouse. I do have a dummy mouse and I'll try that next though. My current XML file is:

<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
  <name>macO2</name>
  <uuid>33aa1771-f3dd-4ad6-9e4a-ca4e168af2af</uuid>
  <memory unit="KiB">16777216</memory>
  <currentMemory unit="KiB">16777216</currentMemory>
  <vcpu placement="static">8</vcpu>
  <os>
    <type arch="x86_64" machine="pc-q35-2.11">hvm</type>
    <loader readonly="yes" type="pflash">/home/scryv/OSX-KVM/OVMF_CODE.fd</loader>
    <nvram>/home/scryv/OSX-KVM/OVMF_VARS.fd</nvram>
    <bootmenu enable="yes"/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <kvm>
      <hidden state="on"/>
    </kvm>
  </features>
  <cpu mode="custom" match="exact" check="none">
    <model fallback="forbid">qemu64</model>
  </cpu>
  <clock offset="utc"/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>destroy</on_crash>
  <pm>
    <suspend-to-mem enabled="no"/>
    <suspend-to-disk enabled="no"/>
  </pm>
  <devices>
    <emulator>/usr/bin/qemu-system-x86_64</emulator>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/home/scryv/OSX-KVM/OpenCore/OpenCore.qcow2"/>
      <target dev="sda" bus="sata"/>
      <boot order="1"/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </disk>
    <disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/home/scryv/OSX-KVM/mac_hdd_ng.img"/>
      <target dev="sdb" bus="sata"/>
      <boot order="2"/>
      <address type="drive" controller="0" bus="0" target="0" unit="1"/>
    </disk>
    <disk type="file" device="disk">
      <driver name="qemu" type="raw"/>
      <source file="/home/scryv/OSX-KVM/BaseSystem.img"/>
      <target dev="sdc" bus="sata"/>
      <boot order="3"/>
      <address type="drive" controller="0" bus="0" target="0" unit="2"/>
    </disk>
    <controller type="usb" index="0" model="ich9-ehci1">
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1d" function="0x7"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci1">
      <master startport="0"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1d" function="0x0" multifunction="on"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci2">
      <master startport="2"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1d" function="0x1"/>
    </controller>
    <controller type="usb" index="0" model="ich9-uhci3">
      <master startport="4"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1d" 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="dmi-to-pci-bridge">
      <model name="i82801b11-bridge"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x1e" function="0x0"/>
    </controller>
    <controller type="pci" index="2" model="pci-bridge">
      <model name="pci-bridge"/>
      <target chassisNr="2"/>
      <address type="pci" domain="0x0000" bus="0x01" slot="0x00" function="0x0"/>
    </controller>
    <controller type="pci" index="3" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="3" port="0x10"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0" multifunction="on"/>
    </controller>
    <controller type="pci" index="4" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="4" port="0x11"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x1"/>
    </controller>
    <controller type="pci" index="5" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="5" port="0x12"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x2"/>
    </controller>
    <controller type="pci" index="6" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="6" port="0x13"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x3"/>
    </controller>
    <controller type="pci" index="7" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="7" port="0x8"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x0" multifunction="on"/>
    </controller>
    <controller type="pci" index="8" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="8" port="0x9"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x01" function="0x1"/>
    </controller>
    <controller type="pci" index="9" model="pcie-to-pci-bridge">
      <model name="pcie-pci-bridge"/>
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    </controller>
    <interface type="network">
      <mac address="52:54:00:08:0b:cc"/>
      <source network="default"/>
      <model type="e1000-82545em"/>
      <address type="pci" domain="0x0000" bus="0x02" slot="0x01" function="0x0"/>
    </interface>
    <input type="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <graphics type="spice" autoport="yes">
      <listen type="address"/>
      <image compression="off"/>
      <gl enable="no"/>
    </graphics>
    <audio id="1" type="none"/>
    <video>
      <model type="virtio" heads="1" primary="yes"/>
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </video>
    <watchdog model="itco" action="reset"/>
    <memballoon model="none"/>
  </devices>
  <qemu:commandline>
    <qemu:arg value="-smbios"/>
    <qemu:arg value="type=2"/>
    <qemu:arg value="-cpu"/>
    <qemu:arg value="Penryn,vendor=GenuineIntel,kvm=on,+invtsc,+pcid,+ssse3,+sse4.2,+popcnt,+avx,+aes,+xsave,+xsaveopt,+fma,+avx2,+bmi1,+bmi2,vmware-cpuid-freq=on"/>
    <qemu:arg value="-device"/>
    <qemu:arg value="isa-applesmc,osk=ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"/>
  </qemu:commandline>
</domain>
1 Comment
2024/05/10
00:02 UTC

2

Issue with new 1440p monitor

Hello!

I have been running VMs for a while now and they work fantastic. I had been running a dual monitor setup, both at 1080p. Lately I chose to try taking a step forward and bought a 1440p monitor. But now I experience a strange issue.

Whenever I boot my VMs, nothing appears. Just black screen. I end up having to force shutdown the computer.

The only way I have been able to workaround this is:

  1. Turn off the 1440p monitor

  2. Boot up VM

  3. VM boots just fine

  4. Turn on the 1440p monitor

Then I have to do this everytime I boot a VM. Sounds like there's something up. I have been trying to figure out if I can spot anything strange by starting the VM by SSH shell through local connection whenever this black screen happens because my 1440p is turned on at the time of turning the VM on, however whenever I run sudo virsh start VM_NAME... nothing happens, Cursor just keeps blinking as if the process is frozen.

Has anyone had a similar experience?

4 Comments
2024/05/09
23:54 UTC

5

Getting 5.1 Sound Hooked up.

So there seems to be many ways to do this.

I have a Sound Blaster 5.1 Digital USB sound card and I don't really want to loose that under Linux so I'm following this guide

8.4 Passing audio from virtual machine to host via JACK and PipeWire https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF#Passing_through_other_devices

However after putting in what I believe to be correct input names, nothing shows in the VM.

There seems to be MORE steps needed but I have no idea what.

The sound input names are : Sound Blaster X4 Digital Surround 5.1 (IEC958/AC3)

Relevent XML lines used:

<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">

...
...
<audio id="1" type="jack">
<input clientName="win11" connectPorts="Sound Blaster X4 Digital Surround 5.1 (IEC958/AC3)"/>
<output clientName="win11" connectPorts="Sound Blaster X4 Digital Surround 5.1 (IEC958/AC3)"/>
</audio>
...
...
qemu:commandline
<qemu:env name="PIPEWIRE_RUNTIME_DIR" value="/run/user/1000"/>
<qemu:env name="PIPEWIRE_LATENCY" value="512/48000"/>
</qemu:commandline>

9 Comments
2024/05/09
00:31 UTC

3

Low cpu usage and low fps

Hello, I have a problem that I have low fps and low cpu usage, the cpu usage should be much higher and such the frame rate. Idk what to fix pls help me. Here is my xml: https://pastebin.com/nYm6qVVM

Edit: My hardware is a asus rog strix laptop with 5800h and 3060 mobile. Display is connected directly to displayport of the gpu which is directly attached to the VM.

https://reddit.com/link/1cnbdu4/video/bo8zdyutu8zc1/player

2 Comments
2024/05/08
18:15 UTC

3

7800X3D Confused with CPU Pinning (another)

Seems this is a common issue, I have a major neulogical issue here as I struggle to understand what I'm doing.

Basically I want to pin my core 1-7 to the Win VM giving core 0 for the Linux Host to use.

I have this so far which is wrong.

<vcpu placement='static'>16</vcpu>

<iothreads>1</iothreads>

<cputune>
<vcpupin vcpu='0' cpuset='8'/>
<vcpupin vcpu='1' cpuset='9'/>
<vcpupin vcpu='2' cpuset='10'/>
<vcpupin vcpu='3' cpuset='11'/>
<vcpupin vcpu='4' cpuset='12'/>
<vcpupin vcpu='5' cpuset='13'/>
<vcpupin vcpu='6' cpuset='14'/>
<vcpupin vcpu='7' cpuset='15'/>
<vcpupin vcpu='8' cpuset='0'/>
<vcpupin vcpu='9' cpuset='1'/>
<vcpupin vcpu='10' cpuset='2'/>
<vcpupin vcpu='11' cpuset='3'/>
<vcpupin vcpu='12' cpuset='4'/>
<vcpupin vcpu='13' cpuset='5'/>
<vcpupin vcpu='14' cpuset='6'/>
<vcpupin vcpu='15' cpuset='7'/>
<emulatorpin cpuset='0-1'/>
<iothreadpin iothread='1' cpuset='0-1'/>
</cputune>

Using the following information to try and come up with something.

<topology>
<cells num='1'>
<cell id='0'>

<memory unit='KiB'>64933720</memory>

<pages unit='KiB' size='4'>16233430</pages>

<pages unit='KiB' size='2048'>0</pages>

<pages unit='KiB' size='1048576'>0</pages>

<distances>
<sibling id='0' value='10'/>
</distances>
<cpus num='16'>

<cpu id='0' socket_id='0' die_id='0' cluster_id='65535' core_id='0' siblings='0,8'/>

<cpu id='1' socket_id='0' die_id='0' cluster_id='65535' core_id='1' siblings='1,9'/>

<cpu id='2' socket_id='0' die_id='0' cluster_id='65535' core_id='2' siblings='2,10'/>

<cpu id='3' socket_id='0' die_id='0' cluster_id='65535' core_id='3' siblings='3,11'/>

<cpu id='4' socket_id='0' die_id='0' cluster_id='65535' core_id='4' siblings='4,12'/>

<cpu id='5' socket_id='0' die_id='0' cluster_id='65535' core_id='5' siblings='5,13'/>

<cpu id='6' socket_id='0' die_id='0' cluster_id='65535' core_id='6' siblings='6,14'/>

<cpu id='7' socket_id='0' die_id='0' cluster_id='65535' core_id='7' siblings='7,15'/>

<cpu id='8' socket_id='0' die_id='0' cluster_id='65535' core_id='0' siblings='0,8'/>

<cpu id='9' socket_id='0' die_id='0' cluster_id='65535' core_id='1' siblings='1,9'/>

<cpu id='10' socket_id='0' die_id='0' cluster_id='65535' core_id='2' siblings='2,10'/>

<cpu id='11' socket_id='0' die_id='0' cluster_id='65535' core_id='3' siblings='3,11'/>

<cpu id='12' socket_id='0' die_id='0' cluster_id='65535' core_id='4' siblings='4,12'/>

<cpu id='13' socket_id='0' die_id='0' cluster_id='65535' core_id='5' siblings='5,13'/>

<cpu id='14' socket_id='0' die_id='0' cluster_id='65535' core_id='6' siblings='6,14'/>

<cpu id='15' socket_id='0' die_id='0' cluster_id='65535' core_id='7' siblings='7,15'/>

</cpus>
</cell>
</cells>
</topology>

lscpu -e

CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE    MAXMHZ   MINMHZ       MHZ
 0    0      0    0 0:0:0:0          yes 5050.0000 400.0000 3510.8970
 1    0      0    1 1:1:1:0          yes 5050.0000 400.0000  400.0000
 2    0      0    2 2:2:2:0          yes 5050.0000 400.0000  400.0000
 3    0      0    3 3:3:3:0          yes 5050.0000 400.0000 3615.7749
 4    0      0    4 4:4:4:0          yes 5050.0000 400.0000  400.0000
 5    0      0    5 5:5:5:0          yes 5050.0000 400.0000  400.0000
 6    0      0    6 6:6:6:0          yes 5050.0000 400.0000 4391.7070
 7    0      0    7 7:7:7:0          yes 5050.0000 400.0000 4398.2388
 8    0      0    0 0:0:0:0          yes 5050.0000 400.0000  400.0000
 9    0      0    1 1:1:1:0          yes 5050.0000 400.0000 3961.1941
10    0      0    2 2:2:2:0          yes 5050.0000 400.0000 3662.4509
11    0      0    3 3:3:3:0          yes 5050.0000 400.0000  400.0000
12    0      0    4 4:4:4:0          yes 5050.0000 400.0000  400.0000
13    0      0    5 5:5:5:0          yes 5050.0000 400.0000 3579.0439
14    0      0    6 6:6:6:0          yes 5050.0000 400.0000  400.0000
15    0      0    7 7:7:7:0          yes 5050.0000 400.0000 4030.7649

I must goto bed now, been up for way too long with bad flu. I simple can't understand this any longer for some reason. If someone is able to help I'd much appreciate it.

I did read several threads and guides already but just can't quite link the info accross to thie 7800X3D.

4 Comments
2024/05/08
15:05 UTC

2

Budget GFX card for passthrough Win 10 Adobe CC

Hi, I'm total newbie, so please be understanding if this post is in the wrong place, or I'll write something stupid :)
I recently abandoned the hated Windows and built myself a PC with Linux Mint. I am very pleased, unfortunately as a graphic designer I have to use Adobe CC, which is available for Windows and OSX only. I reject dual boot because I would like to use Linux while working, so I am left with the KVM option. My processor is Ryzen 5 5600G (integrated GPU), but to run Win10 VM with passtrough I need to have a separate dedicated GPU. So the question is: what inexpensive graphics card is enough to make it possible to work comfortably in Adobe? I have 32 GB RAM.
Any ideas?

1 Comment
2024/05/08
09:43 UTC

3

Is vfio the same as iommu? is it enabled by default?

Noob Question: just had to learn a lot lately about VMs like Qemu, KVM, virt-manager, Libvirt, virtio, so im using currently virt-manager with dGPU passthrough (using laptop monitor), does that mean im using vfio? if not, is this a seperate thing? does it make performance better?

4 Comments
2024/05/08
08:30 UTC

3

Inconsistent performance in certain games

For context I'm attempting single GPU passthrough on a laptop with a Ryzen 9 5900HX and an RTX 3080. I've setup cpu pinning and pinned cores 2-15, added the topoext feature, enabled invtsc, set cache mode to passthrough, set cpu governors to performance, and isolated the pinned cores using systemd; however I keep getting inconsistent results.

For example: In Unigine Superposition extreme 1080p on the VM I get a score of 6300. This is actually acceptable to me, on bare metal I get 7300.

However when I run Cyberpunk 2077, my fps in the VM stays around 30fps, while on bare metal it runs around 78fps. Something I noticed is that my VM's desktop runs smoothly (possibly 165hz) but the cyberpunk UI feels like it's limited at 30hz.

Note: I'm using sunshine + iddsampledriver+moonlight to view the desktop.

Any help anyone could provide would be great, thanks!

Edit: SOLVED! (kinda) I'm not sure what solved it exactly, but I installed windows on another drive and noticed that it also randomly had the same issue where the desktop would run at 165 hz and the game at 30hz. I installed the control center program for my laptop (XMG Neo control center) and changed the profile to performance mode. After that it started working properly on both baremetal and in the VM, and I was able to get roughly the same performance from both. I'm not sure what the issue was, perhaps the tdp of the GPU was being limited, but that doeent explain how the baremetal performance was way higher than the VM in my initial testing.

0 Comments
2024/05/08
07:31 UTC

2

Quick vgpu_unlock and proxmox version

Just wondering if anyone knows the most up to date version of promox to install with vgpu_unlock working? I know polloloco has a guide and its at 8.1 so I was wondering if anyone knew if it continued to work?

Just dont want to keep wiping and reinstalling lol.

Hopefully next post will be a success story after lurking here for years haha

0 Comments
2024/05/08
06:08 UTC

Back To Top