How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Creating ultra fast virtual machines of old operating systems for fun and profit
Post Reply
User avatar
MattKC
Site Admin
Posts: 323
Joined: Mon Aug 22, 2022 1:05 am
Contact:

How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by MattKC »

Windows XP needs no introduction. For many current computers users, it comprises their first memories of computer usage and is the ultimate expression of tech nostalgia. You still see it in use on legacy systems that are considered too costly/dangerous to upgrade.

So what if you wanted to try it on modern hardware?

Honestly, XP is old. Over 20 years old. There's a lot of hardware that does not and never will support XP. Drivers that are as basic, yet critical, as SATA disk drivers may simply be unavailable for Windows XP, and this gradual loss of compatibility will only continue to get worse. If only you could somehow... simulate the hardware that isn't compatible, but then use native hardware wherever possible for maximum performance... Thunking

As with my Windows 7 tutorial, this will assume a degree of experience with GPU passed-through virtual machines and setting them up. There are plenty of other guides that I recommend reading if you're just getting started.

This will primarily cover the specific things you'll have to do in order to get Windows XP running and working with a native GPU over other operating systems. For reference, I'm using the ATI Radeon HD 3870 from 2007 as my guest GPU.
  1. virt-manager doesn't have a built-in definition for Windows XP, so go ahead and pick "Generic OS".
  2. Set up the RAM/disk storage how you'd like, but make sure to click "Customize configuration before install" before finishing.
  3. In the configuration, set the "Chipset" to "Q35". Q35 doesn't officially support XP, but the alternative "i440fx" doesn't support PCI-e, which will cause problems if we're trying to passthrough a PCI-e GPU. Thankfully, there are things we can do to get XP working on Q35 that will be covered in this tutorial. Also, keep "Firmware" set to "BIOS" (while some claim GPU passthrough is only possible with OVMF/UEFI, this is not true in my experience).
  4. virt-manager may have automatically connected an IDE drive, however since we switched the machine to Q35, it will then complain that IDE drives are incompatible. Go ahead and remove it, instead swap it out with a SATA drive.
  5. With the latest Q35, Windows XP will consistently BSOD on startup saying "The BIOS in this system is not fully ACPI compliant" with error code 0x000000A5. To fix this, you must use an older version of Q35. To do so, switch to XML editing mode and find the section that looks like this:

    Code: Select all

    <os>
      <type arch="x86_64" machine="pc-q35-7.2">hvm</type>
    </os>
    
    As you can see, the Q35 version is listed under the "machine" attribute. Note that your version of Q35 may be different than "7.2", virt-manager will default to the latest version available. To run XP, this attribute must be changed to "pc-q35-2.10".
  6. The network interface will default to "e1000" for an Intel Gigabit Ethernet Controller. I haven't managed to find drivers for this yet, but QEMU can also emulate a Realtek RTL8139 which Windows XP supports out of the box (the downside is that it maxes out at 10/100 speeds). Having network access at the beginning greatly simplifies setting up other drivers/software, so I recommend switching this at least for initial setup (if you switch back to e1000 and find a compatible driver, let me know!) To switch it in virt-manager, edit the "Device Model" under NIC from "e1000" to "rtl8139".
  7. Optionally, add your passed through GPU and set "Video" in virt-manager to "None". Alternatively, you can do the initial setup with the virtual GPU and swap in the hardware GPU later, this is totally up to you. However, note that XP will not support both GPUs at once - you must lose the virtual GPU to get the hardware GPU and vice versa.
    • As mentioned in the Windows 7 tutorial, whenever you're ready to start using your hardware GPU, you must enable x-vga or else the GPU will not initialize. To do so, replace the top "<domain type="kvm">" line with the following to allow specifying custom QEMU commands:

      Code: Select all

      <domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
      
      And then add the following lines to the end of virsh XML (before "</domain>" at the end).

      Code: Select all

      <qemu:override>
        <qemu:device alias="hostdev0">
          <qemu:frontend>
            <qemu:property name="x-vga" type="bool" value="true"/>
          </qemu:frontend>
        </qemu:device>
      </qemu:override>
      
  8. We're almost ready for installation. There's only one last thing to add: XP does not ship with the SATA drivers for the hardware that Q35 emulates, so we'll need to load them from floppy disk at startup. If we don't, the setup will BSOD with error code 0x0000007B. For your convenience, here are the drivers you'll need in a convenient floppy image:
    ich9-flp.img
    (1.41 MiB) Downloaded 419 times
    Make sure to add this to your VM before starting (though don't enable it as a boot device because it isn't bootable).
    • Alternatively, Q35 does support SCSI drives, which XP will be compatible with out of the box. This will work, and you can install and run XP this way, but I found this painfully slow. Expect installation to take hours and for XP itself to be extremely unresponsive (simply clicking the start menu may take minutes. I highly recommend not bothering with SCSI and just starting off with the SATA drivers).
  9. To load the driver at startup, boot into the XP setup CD. Near the beginning, the setup will pause for a few seconds allowing you to "press F6 if you need to install a third party SCSI or RAID driver". Don't be fooled by the lack of SATA mention, this is what we want. Ensure the aforementioned floppy image inserted, and press F6. Nothing will appear to happen at first, but it will ask you for a driver once it's finished initialization.
  10. Once the rest of the setup has loaded, it will prompt you to load a driver. Press S to show a list of drivers from the floppy disk. From the list, you'll want to select "Intel(R) ICH9R/DO/DH SATA AHCI Controller".
  11. Once selected, press "Enter" to continue. From here on, Windows XP installation should proceed as normal! You can remove the floppy disk any time from now because the installer will copy the driver into the XP install.

    Oddly, you may encounter into a BSOD when the installer attempts to reboot, however this doesn't appear to cause any problems (it doesn't occur while anything important is happening, just while it's trying to reboot the PC). Just force reset and the installation will continue as normal.
As long as you're using SATA (rather than SCSI), installation should finish in just a few minutes. And if you chose rtl8139 as your NIC, you should have internet access immediately after installation. I guess that'll be important if you need to, like, activate or something. But honestly, who does that YEP

Hope this helps, and if it does, enjoy your near-native XP installation! In my experience, it's incredibly snappy. I don't think I've ever used an XP installation this responsive. It's faster than VMware (presumably due to the lower overhead of a hardware GPU), and I'd bet it's faster than any native hardware that ever fully supported XP (particularly because that hardware is probably 10+ years old by now). Now I can do all sorts of... XP... things...
Last edited by MattKC on Thu Mar 02, 2023 5:47 pm, edited 1 time in total.
User avatar
flatrute
Posts: 307
Joined: Sat Dec 17, 2022 11:32 am
Location: Thành phố Hồ Chí Minh, Việt Nam
Contact:

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by flatrute »

I wonder how much of this can be adapted to Windows 2000 since that is the OS I am most fond of...
It turns out leaving an Internet identity behind is hard MikeBruh

My username is read as "flatorte".

[deleted] posts index

Avatar source
User avatar
MattKC
Site Admin
Posts: 323
Joined: Mon Aug 22, 2022 1:05 am
Contact:

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by MattKC »

flatrute wrote: Thu Mar 02, 2023 6:15 am I wonder how much of this can be adapted to Windows 2000 since that is the OS I am most fond of...
I've actually been trying this lol. I think the issue I'm running is that there aren't any ICH9R SATA drivers for Windows 2000 (like the ones I install in this guide), though I'm not sure if that's the only issue. I got a lot further using the "i440fx" machine type (which virtualizes older hardware and supports IDE) rather than Q35, but then for some reason the graphic card wouldn't start up, despite the drivers installing fine, the card being recognized in device manager, and "working properly" according to it. This may be because i440fx apparently doesn't support PCI-e, and the card is being presented as PCI device instead - the driver may be getting thrown off by that?

Either way, I am seeing if I can get it to work haha.
User avatar
MattKC
Site Admin
Posts: 323
Joined: Mon Aug 22, 2022 1:05 am
Contact:

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by MattKC »

Yep Windows 2000 works! Largely due to the help of a guy in Japan who ported not only Intel SATA drivers to Windows 2000 (which didn't end up being necessary because I stuck for i440fx for better compatibility), but also ATI Radeon drivers so my current GPU would work. What an unbelievably talented guy. I guess I'll do a writeup about this if there's interest.
User avatar
flatrute
Posts: 307
Joined: Sat Dec 17, 2022 11:32 am
Location: Thành phố Hồ Chí Minh, Việt Nam
Contact:

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by flatrute »

MattKC wrote: Tue Mar 07, 2023 9:58 am Yep Windows 2000 works! Largely due to the help of a guy in Japan who ported not only Intel SATA drivers to Windows 2000 (which didn't end up being necessary because I stuck for i440fx for better compatibility), but also ATI Radeon drivers so my current GPU would work. What an unbelievably talented guy. I guess I'll do a writeup about this if there's interest.
Ah yes...our lord and savior 黒翼猫 also known as BlackWingCat GIGACHAD Windows 2000 is my early childhood so a writeup related to the OS would be nice. Also related to Japan, did you know you can close the Start Menu (at least in Windows 95)?
It turns out leaving an Internet identity behind is hard MikeBruh

My username is read as "flatorte".

[deleted] posts index

Avatar source
User avatar
Jellington
Posts: 5
Joined: Sun Jun 18, 2023 2:42 pm

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by Jellington »

There's only one last thing to add: XP does not ship with the SATA drivers for the hardware that Q35 emulates, so we'll need to load them from floppy disk at startup. If we don't, the setup will BSOD with error code 0x0000007B. For your convenience, here are the drivers you'll need in a convenient floppy image:
One might as well use virtio storage options with their drivers since XP doesn't have built-in drivers for modern storage options anyway. Paravirtualized drivers might be better in terms of performance as well, since they don't have to reimplement the whole bus protocol from scratch.
I belive 0.1.190 was the last version that shipped with floppy images: https://fedorapeople.org/groups/virt/vi ... 0.1.190-1/, though newer version are available as ISOs.
QEMU 7.2 has a bug that prevents simple virtio-blk from properly working when TRIM/unmap is enabled that isn't fixed yet, though patches are already available. virtio-scsi works just fine, albeit you can't just select it in virt-manages so you have to virsh edit the config. Here's an exple config using raw block device (I store my VMs on separate LVM volumes).

Code: Select all

    <controller type='scsi' index='0' model='virtio-scsi'>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </controller>

    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native' discard='unmap' detect_zeroes='unmap'/>
      <source dev='/dev/mapper/vms-winmain'/>
      <target dev='sda' bus='scsi'/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/mapper/vms-winextra'/>
      <target dev='sdb' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='1' unit='2'/>
    </disk>
Edit:
virt-manager doesn't have a built-in definition for Windows XP, so go ahead and pick "Generic OS".
It does, you just have to click the end of life checkmark. Maybe it's something specific to Arch or its derivatives, but I doubt that since there's no such flag in PKGBUILD.
Screenshot_20230618_181803.png
User avatar
MattKC
Site Admin
Posts: 323
Joined: Mon Aug 22, 2022 1:05 am
Contact:

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by MattKC »

Jellington wrote: Sun Jun 18, 2023 2:57 pm One might as well use virtio storage options with their drivers since XP doesn't have built-in drivers for modern storage options anyway. Paravirtualized drivers might be better in terms of performance as well, since they don't have to reimplement the whole bus protocol from scratch.
Yes you're right, at the time I wrote this, I didn't know there were virtio drivers for XP, but that's a better solution than relying on emulated storage. The guide probably needs to be updated for that.
Jellington wrote: Sun Jun 18, 2023 2:57 pm It does, you just have to click the end of life checkmark.
Ahh somehow I never noticed this checkbox. I'll probably update the guide for this too at some point.
Gravarty
Posts: 2
Joined: Wed Jul 26, 2023 11:25 pm

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by Gravarty »

Thansk for the tutorial! Unfortunately i'm having trouble getting the NVIDIA drivers to work. Windows XP installed all other drivers like USB and Ethernet just fine but the NVIDIA drivers just refuse to work and is stuck on "Code 10".
It works fine in Windows 7 and Vista, though. (GTX 950)
User avatar
MattKC
Site Admin
Posts: 323
Joined: Mon Aug 22, 2022 1:05 am
Contact:

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by MattKC »

Gravarty wrote: Wed Jul 26, 2023 11:29 pm Thansk for the tutorial! Unfortunately i'm having trouble getting the NVIDIA drivers to work. Windows XP installed all other drivers like USB and Ethernet just fine but the NVIDIA drivers just refuse to work and is stuck on "Code 10".
It works fine in Windows 7 and Vista, though. (GTX 950)
NVIDIA cards are tough because their cards have anti-VM protection. It should work if you add the following under "<features>":

Code: Select all

<kvm>
  <hidden state='on'/>
</kvm>
And the following under the "<hyperv>" section:

Code: Select all

<vendor_id state="on" value="randomid"/>
(you can replace "randomid" with a random alphanumeric string, but leaving it as "randomid" seems to work anyway)
Gravarty
Posts: 2
Joined: Wed Jul 26, 2023 11:25 pm

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by Gravarty »

Oh sorry, yeah I forgot to mention that I already have this enabled. I'm starting to think that maybe Q35 2.10 is just too old for my NVIDIA card. It's strange as it's only the video driver that refuses to start, NVIDIA Audio drivers work fine.
Shutting down the VM also causes funny glitches where the Plymouth background image is replaced with a garbled Windows XP login screen.

EDIT: After trying many ways to install XP on a KVM, I finally found the issue and yeah, I made a mistake lol :D While I actually added the Nvidia driver fix, I forgot to add the vendor line that was also required to fix the issue -.- :D
Flaky
Posts: 3
Joined: Sun Oct 15, 2023 11:47 pm

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by Flaky »

I was able to get everything to work! GPU works with the VM detection bypasses, and audio works too! (though I would use PulseAudio for the audio link over SPICE - don't worry, PipeWire also has a Pulse server).

I've kept my old posts in spoilers but I'll probably make a new tutorial post here so it's documented somewhere. I'm gonna try installing XP through a VirtIO drive this time around, heard there were F6 drivers for XP. No VirtIO drivers work for me right now so I'm gonna stick to SATA there.

Original post about sound:
Hitting a brick wall with the sound. ICH6 and ICH9 all give me Red Hat device IDs. AC97 is detected but I get Code 12 errors (not enough resources, from what I've seen it's under the same "slot" in Device Manager as the Ethernet controller). ES1370 will install and I can get the volume icon, but no sound is heard (even when setting it up to go through PulseAudio) and it even lags when adjusting volume.

I'll do some more adjustments to the VM, see if it was an issue from how it was set up. I'm so close, just the sound needs sorting for XP.

Original post:
Original post about USB:
Trying to do this and I'm having less issues with GPU passthrough and more issues with USB passthrough. Some keyboards won't work while I try to mash F6 and I get 0x7B, but some will work while mashing F6 but don't when it gets to the first installer screen, in fact when the installer takes control they keyboard essentially gets "spat out" back to the host when it gets to that screen. Even tried to slipstream some USB drivers, didn't work. Same result. Everyone else on this thread is saying USB is working fine for them, so what am I doing wrong?

I don't think it's an issue with the USB device being too new for it in the case of it getting spat out, otherwise it wouldn't have worked on the BIOS segment.
Edit: I managed to get a keyboard that wasn't working to work with SPICE's USB redirection. I'm not sure if this is the best way to go about it, but whatever - it's working! I'll let you know if there's any issues with GPU passthrough but in any case, thanks for this tutorial, Matt.

Edit 2: No issues with GPU passthrough! Make sure to mask the fact you're using a VM, and also make sure to disconnect from the internet otherwise the NVIDIA installer will try to download .NET 4 for GeForce Experience. Only thing missing now is sound drivers.
PortalPlayer
Posts: 6
Joined: Sat Jul 29, 2023 12:09 am

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by PortalPlayer »

This works fine for me, but when I restart Windows XP, I wouldn't get any output, and my computer would start lagging heavily. Stopping it would let my computer go to full speed again. If I try starting it again, then there's a high chance my PC would freeze. I have a Windows Vista GPU passthrough, and it doesn't do the same to that one. My feeling is that my computer doesn't like pc-q35-2.10
IntriguingTiles
Posts: 1
Joined: Sat Mar 25, 2023 11:29 pm

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by IntriguingTiles »

PortalPlayer wrote: Mon Nov 13, 2023 12:43 am This works fine for me, but when I restart Windows XP, I wouldn't get any output, and my computer would start lagging heavily. Stopping it would let my computer go to full speed again. If I try starting it again, then there's a high chance my PC would freeze. I have a Windows Vista GPU passthrough, and it doesn't do the same to that one. My feeling is that my computer doesn't like pc-q35-2.10
What GPU are you using? I've had similar issues when passing my Radeon HD 43XX/45XX card to Windows 7.
PortalPlayer
Posts: 6
Joined: Sat Jul 29, 2023 12:09 am

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by PortalPlayer »

IntriguingTiles wrote: Tue Nov 14, 2023 7:05 am What GPU are you using? I've had similar issues when passing my Radeon HD 43XX/45XX card to Windows 7.
I have two GPUs in this computer. One GTX 1650, and a GT 220. I pass the GT 220 to the Windows XP and Windows Vista VM. I can restart Windows Vista perfectly fine, but the Windows XP VM breaks after restarting it, requiring the host PC to restart. Changing the Q35 version to be something newer fixes that problem, but then Windows XP would not work anymore.

EDIT: Other than that, Windows XP works perfectly fine, as long as I don't restart
Nukley
Posts: 2
Joined: Thu Jun 22, 2023 8:12 pm

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by Nukley »

Hello, I followed your guide and I got pretty far, my iommu is set up correctly (I'm pretty sure, atleast) and my vm is set up like this:

Code: Select all

<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="kvm">
  <name>winxp</name>
  <metadata>
    <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0">
      <libosinfo:os id="http://microsoft.com/win/xp"/>
    </libosinfo:libosinfo>
  </metadata>
  <memory unit="KiB">524288</memory>
  <currentMemory unit="KiB">524288</currentMemory>
  <vcpu placement="static">2</vcpu>
  <os>
    <type arch="x86_64" machine="pc-q35-2.10">hvm</type>
    <boot dev="hd"/>
  </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="qcow2" discard="unmap"/>
      <source file="/var/lib/libvirt/images/winxp.qcow2"/>
      <target dev="sda" bus="sata"/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </disk>
    <disk type="file" device="cdrom">
      <driver name="qemu" type="raw"/>
      <source file="/home/red/drivers.iso"/>
      <target dev="sdb" bus="sata"/>
      <readonly/>
      <address type="drive" controller="0" bus="0" target="0" unit="1"/>
    </disk>
    <disk type="file" device="floppy">
      <driver name="qemu" type="raw"/>
      <source file="/home/red/Downloads/ich9-flp.img"/>
      <target dev="fda" bus="fdc"/>
      <address type="drive" controller="0" bus="0" target="0" unit="0"/>
    </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="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-to-pci-bridge">
      <model name="pcie-pci-bridge"/>
      <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="0x11"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x1"/>
    </controller>
    <controller type="pci" index="4" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="4" port="0x12"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x2"/>
    </controller>
    <controller type="pci" index="5" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="5" port="0x13"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x3"/>
    </controller>
    <controller type="pci" index="6" model="pcie-root-port">
      <model name="pcie-root-port"/>
      <target chassis="6" port="0x14"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x4"/>
    </controller>
    <controller type="fdc" index="0"/>
    <controller type="virtio-serial" index="0">
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    </controller>
    <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="mouse" bus="ps2"/>
    <input type="keyboard" bus="ps2"/>
    <audio id="1" type="none"/>
    <hostdev mode="subsystem" type="pci" managed="yes">
      <source>
        <address domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
      </source>
      <address type="pci" domain="0x0000" bus="0x05" 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="0x06" slot="0x00" function="0x0"/>
    </hostdev>
    <hostdev mode="subsystem" type="usb" managed="yes">
      <source>
        <vendor id="0x0bda"/>
        <product id="0xb812"/>
      </source>
      <address type="usb" bus="0" port="2"/>
    </hostdev>
    <memballoon model="virtio">
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </memballoon>
  </devices>
  <qemu:override>
    <qemu:device alias="hostdev0">
      <qemu:frontend>
        <qemu:property name="x-vga" type="bool" value="true"/>
      </qemu:frontend>
    </qemu:device>
  </qemu:override>
</domain>
Upon booting the vm everything seems to be fine, except for the big issue of the passthrough literally not working...
"No Signal" my VGA monitor screams!

Graphics drivers were installed, it gave me no problems during the installation.
Device manager shows the drivers are installed, except for an error that they aren't working (when I have the vm's video output set to QXL)

Host's GPU: GTX 1060
Guest's GPU: Radeon x300/x600 (Pulled out of an old dell)

Any help with figuring this out would be greatly appreciated!
User avatar
MattKC
Site Admin
Posts: 323
Joined: Mon Aug 22, 2022 1:05 am
Contact:

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by MattKC »

I notice you have 3 "hostdev"s set up in your XML file, perhaps the QEMU "hostdev0" argument is attaching to the wrong one? Try playing around with the "hostdev0" ID (maybe try "hostdev1" and "hostdev2"), or limiting the number of hostdevs to just your graphics card alone for the time being?
PortalPlayer
Posts: 6
Joined: Sat Jul 29, 2023 12:09 am

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by PortalPlayer »

This doesn't work for me anymore. I still get the ACPI compliance error, even though I have the machine set to pc-q35-7.2

I guess an update broke it.
Flaky
Posts: 3
Joined: Sun Oct 15, 2023 11:47 pm

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by Flaky »

PortalPlayer wrote: Sun Feb 25, 2024 6:11 pm This doesn't work for me anymore. I still get the ACPI compliance error, even though I have the machine set to pc-q35-7.2

I guess an update broke it.
Did 7.2 work before? Matt's tutorial says to use 2.10, hence why I'm asking, and I'm installing XP with a VM using 2.10 right now.

Anyhow, has anyone ever got VirtIO working with Windows XP? I've been unsuccessful in it so far.
User avatar
Jellington
Posts: 5
Joined: Sun Jun 18, 2023 2:42 pm

Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM

Post by Jellington »

Flaky wrote: Mon Feb 26, 2024 7:57 pm Anyhow, has anyone ever got VirtIO working with Windows XP? I've been unsuccessful in it so far.
Seems to have worked without issues for me last time I tried to make a VM with a spare GT 610. You have to use F8 and the 0.1.190 floppy to get Windows to install to virtio-blk (alternatively inject them directly into the ISO via nLite), but all the other drivers installed just fine. Screenshot is x64 edition, but regular x86 Professional worked just fine as well.
untitled.PNG
Fun fact, the same virtio-blk drivers work on Windows 2000 as well, but it's a bit buggy as it reports 7 duplicate disk drives instead of just one.
Post Reply