Installing VirtIO drivers into Windows7 is a very painful process as it involves multiple devices communications and a "chicken and egg" problem. However, using virtIO drivers provides a large speed boost over the host-guest IO communications since QEMU does not need to emulate a hardware just to perform an I/O operations.
It involves 3 stages of proper setup before you can proceed to use it. These steps are critical so pay attention closely. Also, since this is a 1 time effort, you are advised to use libvirt-manager interface to simplify the progress. This guide is written in a way to scroll from top to bottom without jumping around.
If you're looking for ways to counter anti-VM techniques like Nvidia graphic cards and some other software, installing virtio driver is a dead give away traces where the driver is only being used in QEMU VM. Hence, avoid it if you're looking for countering anti-vm implementations.
Now, you can create a VM as usual. You need the Windows 7 Installer ISO file in order to set things up. However, in this step these are the things you need to watch out:
SATA
SATA
VirtIO
This way, you can install Windows7 in the most optimized manner at this stage. Shut down the Windows 7 right after a successful login.
This step is now setting up the VirtIO driver inside the Windows 7 driver. These are the steps in sequences.
Once you're done, proceed to download VirtIO signed driver from Fedora Red Hat here: https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html. You should get an ISO file based on your guest VM configurations. The name should be:
Stable - virtio-win.iso
Now, you need to add a new dummy hard disk for triggering a driver install inside Windows 7. Set the hard disk to:
Any
size, recommended 5GBDisk Device
VirtIO
none
native
We need to install virtIO driver into Windows 7. Now boot up the Windows.
Once inside, mount the VirtIO driver into the CDROM just like the Windows 7 Installer ISO. This will facilitates all the contents inside the ISO file.
Now most of the drivers require manual installation. Hence, bring up your device manager for unknown devices. Right click and update the driver. Point them to the CD-ROM and get all of them to get installed.
By the completion time, you should have your network and dummy hard disk drivers installed and connected.
After all the drivers are installed, give it a reboot for a quick refreshment.
Next is to reset the Hard Disk I/O registry to allow Windows to re-recognize the I/O mode. Otherwise, you will bump into the hard disk boot up bluescreen.
1. bring up the regedit
editor and seek out these folders and do the step #2 for each of them:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\msahci
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\pciide
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\iaStorV
2. Each of them has a "start" registry. Double click it and set it to zero.
3. Once you're done, close the editor.
We're now ready to switch the hard disk I/O mode. Shutdown the Windows.
We are now ready to switch the hard disk I/O mode to virtIO for very fast read/write speed in QEMU. Head over the VM settings for configurations.
Now, you can safely set the hard disk to:
VirtIO
none
native
This will give a great boost over the hard disk read/write.
At the same time, we do not need the dummy disk anymore, remove it from your VM. Please make sure you remove the image disk as well to recover the disk space.
Once all are done, you can power up the Windows 7. Now, your bootable hard disk is using virtio driver and feel the speed boost offered by QEMU.
That's all about getting VirtIO into Windows7.