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...
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.
- virt-manager doesn't have a built-in definition for Windows XP, so go ahead and pick "Generic OS".
- Set up the RAM/disk storage how you'd like, but make sure to click "Customize configuration before install" before finishing.
- 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).
- 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.
- 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:
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".
Code: Select all
<os> <type arch="x86_64" machine="pc-q35-7.2">hvm</type> </os>
- 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".
- 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:
And then add the following lines to the end of virsh XML (before "</domain>" at the end).
Code: Select all
<domain xmlns:qemu="http://libvirt.org/schemas/domain/qemu/1.0" type="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>
- 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:
- 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:
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).
- 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.
- 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".
- 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.
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...