After a whole lot of struggling, I’ve finally figured out the best way to install a Windows virtual machine under KVM, using the paravirtual (virtio) drivers. The basic idea is to use the virtio devices from the initial installation to avoid all the work and hassles involved with changing the drivers later. This avoids mistakes which can lead to an unbootable guest or “Local Area Connection 2” annoyances.
Thanks to Stefan Skotte and Andy for updates to simplify this procedure.
- Download the latest virtio drivers (in ISO format).
- Create a new virtual machine as you normally would for a Windows guest, stopping just before clicking Finish.
- If you have a new enough version of virt-manager, you can check the “Customize configuration before install” checkbox. Otherwise, click Finish, stop the virtual machine, open the details, reconnect the CD (or other installation media) if necessary, and reconfigure the guest to boot off the CD (or other installation media).
- Delete the IDE disk device and re-add the storage as a Virtio disk.
- Change the NIC’s device model to virtio.
- Switch to the console view, run the virtual machine, and start the installation as normal.
- When the disk configuration step comes up, no disk will be detected. This is normal.
- Click Load driver…
- Switch to the details view, disconnect the Windows installation CD, and connect the virtio ISO image.
- Switch back to the console view and click Rescan.
- Select the virtio block storage and virtio network drivers for the Windows version being installed, using the control key to select multiple items as always.
- Click Next.
- Switch to the details view, disconnect the drivers CD, and connect the Windows installation CD again.
- Proceed with the installation as normal.
- Reconfigure the boot options, if necessary, as desired.
- Disconnect the CD device, if necessary and desired.