Re: How I set up Windows XP GPU passthrough with libvirt/QEMU/KVM
Posted: Wed May 01, 2024 3:09 pm
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).
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).
Oh, and you need x-vga as well, as was stated before. Change <domani type='kvm'> to <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> and then add after </devices>:
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.
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
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'/>
</hyperv>
<kvm>
<hidden state='on'/>
</kvm>
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>
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.