Windows 7 as a QEMU-KVM guest

While Windows 7 seems to run quite okay as a QEMU-KVM guest on my home server – which I will cover in another posting – there are a few things that I’ve noticed and that should be kept in mind when playing around with such setup.

Even while idle – about 0% CPU usage shown in the guest – the guest seems to cause between 5 and 10% single core CPU usage on the host machine and close to 5000 context switches per second. This isn’t really much, but still causes about 20 watts of additional power usage here when compared to a completely idle host machine.

At first I was a bit surprised to see only two CPU cores available in the guest even though I had configured four cores in the guest domains XML configuration. Turns out that QEMU seems to present the CPU cores as single core CPUs in different sockets to the guest machine by default – and Windows 7 is limited to one or two sockets, depending on the version used (more information here). This can be changed by providing a “topology” setting in the XML config:

  <cpu>
    <topology sockets='1' cores='4' threads='1'/>
  </cpu>

 

This configures the host to show a single-socket four-core CPU to the guest.
The host CPU configuration/layout can be displayed via “virsh capabilities”:

# virsh capabilities | grep topology
      <topology sockets='1' cores='6' threads='1'/>
#

 

For some reason my QEMU-KVM setup decided to show the bridged network interface as a FastEthernet NIC within the guest. Adding a “model” statement to the “interface” section within the XML config helped, now I’m having a nice e1000 NIC in the guest 😉

    <interface type='bridge'>
      <mac address='52:54:00:22:22:22'/>
      <source bridge='br0'/>
      <model type='e1000'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>

 

 

A description of the libvirt Domain XML file and most configuration items/settings can be found here.

Comments are closed.