Preface
Being 2023, you would be surprised on how many machines running Windows XP are out there. Of course it is the worst idea ever to have a running xp box, but it is what is when the customer requires it.
Assumptions:
- You have a running setup of KVM/Qemu. You can check my guide here.
- You use virt-manager to manage and create virtual machines.
- You have a Windows XP x86 SP3. This method may work for Windows XP 64 bits but I have not tested it.
1. Create the virtual machine
Fire up virt-manager
- Choose the ISO image location and when you have to choose the operating system, click the "Include end of life operating systems" check mark to have Windows XP as an option:
- Assign 1 GB of RAM and 1 CPU.
- Assign the disk size. Up to you but for a basic install 10GB is more than enough.
- Click on "Customize configuration before install" and "Finish".
- Change sound device to "AC97".
- IMPORTANT:Remove the network card. Important. If not, the installation may hang. We will add one later.
- Make sure that the dis bus is "IDE" for the hard disk and CDROM devices.
- Make sure that the video controller is set to "QXL".
- Go to "Boot Options". mark "Enable boot menu" and check and move the CDROM to the top of the list. KVM uses the CDROM on boot for the OS installation, and then dismounts it. This may cause the Windows XP installation to fail as it reboots and checks for the CD on the first installation phase.
- Click on "Begin Installation" (top left corner).
Install Windows XP
Not much to say here, just choose a quick NTFS formatting as you are using a virtual disk and performance gain from formatting it is not going to make any difference.
2. Install the virtio drivers
Virtio drivers are equal to guest additions in virtualbox or vmware tools on vSphere. If you want to have some nice features such as hardware pass through and memory ballooning, you must install them.
They are not pre-compiled as Windows binaries by default on their GitHub page, but fortunately there are various sources that do that for us. The most reliable I have found is the Fedora project repository.
Here you have a myriad of versions. Many of them will fail or cause issues. This is the version that worked for me:
- Download the ISO for version 0.1.185-2.
- Mount the ISO on Windows XP - you can do it with the virtual machine powered on.
- Open the device manager in Windows XP. You will see various unrecognized devices:
You have to install the drivers one by one the old windows way pointing to the proper driver's folder:
PCI Simple Communications controller (virtio serial driver): yourcdromletter:\vioserial\xp\x86
Video controller(VGA compatible): yourcdromletter:\qxl\xp\x86
PC Device: yourcdromletter:\Balloon\xp\x86. This is quite important as it provides memory ballooning capabilities.
Install the Qemu guest agent: yourcdromletter:\guest-agent\qemu-ga-i386.msi.
Shutdown Windows XP and add a network card. Choose the "virtio" driver.
Power on windows and install the network driver at yourcdromletter*:\NetKVM\xp\x86.
4. Configure memory ballooning
With the virtual machine powered off, configure the range of the RAM you want to assign:
5. Optional: add a SCSI disk.
Add an additional disk with the "virtio" Disk Bus. The driver is in yourcdromletter:\viostor\xp\x86
6. The end.
Now you have a perfectly functional Windows XP vm, and one of themost insecure-by-design operating systems ever created.
Comentarios
Publicar un comentario