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
User avatar
Posts: 6
Joined: Sun Jun 18, 2023 2:42 pm

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

Post by Jellington »

Got 2000 VM working with my 610, though it's less of a QEMU/passthrough issue than a driver issue.

1. First of all, there's a bug with my GT 610 (and possibly other cards of that era) that makes the passthrough fail to work, usually after stopping and starting the VM again. I've managed to solve it by dumping the BIOS while the VM is running (if it isn't, dumping throws and error).

Code: Select all

# echo 1 > /sys/bus/pci/devices/0000:0x:00.0/rom
# cat /sys/bus/pci/devices/0000:0x:00.0/rom > gt610.rom
# echo 0 > /sys/bus/pci/devices/0000:0x:00.0/rom
After that, specify the ROM file in libvirt config by adding <rom file='/path/to/rom/gt610.rom'/> in the hostdev section.

2. Then there's a code 43 issue, solved by hiding the VM state (not sure if it's applicable to the hacked 2000 drivers, but it was the case on everything XP and newer).

Code: Select all

<hyperv mode='custom'>
  <vendor_id state='on' value='66666'/>
  <hidden state='on'/>
Oh, and you need x-vga as well, as was stated before. Change <domani type='kvm'> to <domain type='kvm' xmlns:qemu=''> and then add after </devices>:

Code: Select all

    <qemu:device alias='hostdev0'>
        <qemu:property name='x-vga' type='bool' value='true'/>
3. Basic Windows 2000 SP4 ISO is horribly outdated and won't even allow you to install Extended Kernel/Core (which is needed for the graphics driver and most of the XP-era and newer apps). There exists HFSLIP that lets you make a pre-updated ISO ready to go, instructions can be seen here at steps 1 to 4.

4. Some virtio drivers work on 2000 without much issues, that includes virtio-serial driver (can be just installed from device manager) and viostor (need to use 0.1.190 floppy and press F6 during setup, the disk shows as eight separate SCSI devices, but you can just proceed installing it to the disk with ID 7). Official virtio-net drivers dropped 2000 support a long time ago, but old Qumranet driver works just fine.

5. For patched Nvidia drivers to work, you need to install Extended Kernel *and* Extended Core. Download Windows2000-KB935839-v31hM-x86-ENU.wlu here, then extract it with 7zip, install it by running install.bat, rebooting when it finishes installing prerequisitory updates, then running it again. After that download and extract Windows2000-KB979683-v14b-x86-ENU.wlu and install it by running update.exe in update folder.

6. Finally, Nvidia drivers themselves can be found here, I found that 310.70 works just fine while 359.06 doesn't work at all. Nothing much to write about here, install it in device manager by picking nv4_disp.inf.

With all that done, I now have a pretty usable system that's on par with XP in terms of software support while still offering that glorious pixel-perfect classic bitmap UI. For browsers, latest version of Mypal (68.14.0b) works without even needing fcwin088 to spoof system version. Supermium sadly doesn't work, showing broken empty window, but its devs were planning to bring the native support for unpatched systems at one point anyway.
User avatar
Posts: 326
Joined: Sat Dec 17, 2022 11:32 am
Location: Thành phố Hồ Chí Minh, Việt Nam

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

Post by flatrute »

Windows 2000 is my childhood operating system and I am glad that someone tried to set up it for the modern eras FeelsGoodMan Therefore this post should be renamed a bit from XP to NT 5.x or something Thuink
It turns out leaving an Internet identity behind is hard MikeBruh

My username is read as "flatorte".

[deleted] posts index

Avatar source
Posts: 9
Joined: Sat Jul 29, 2023 12:09 am

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

Post by PortalPlayer »

Is there anyway to have this running in a separate window? I have two GPUs, and the second one is being using exclusively for VMs. Normally, you would use something like Looking Glass, but obviously that doesn't support Windows XP/Vista (nor will it ever, seems like their only solution is to upgrade the VM to Windows 10/11).
Post Reply