Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 2 VMs running as guests on a KVM virtualization platform running on Ubuntu 10.04. One VM is an Ubuntu 10.04 system, the other is a Windows 7 system. When both machines are completely logged out, the Linux machine uses 1% CPU, the Windows one 45-50%, according to top. The graphs in virt-manager seem to back this up. There's nothing installed on the Win7 image that would be running in the background; its as fresh as can be.

Why is the Windows VM using so much more than the Linux VM, when both are logged out and idling?

Edit:

I installed the guest with paravirt storage and network drivers from the get-go. I don't believe there are any other drivers that I'm missing, am I wrong?.

According to the guest's task manager, it is indeed idle. Taskman takes about 1 or 2 % of the guest CPU, but there's no other processes taking up any CPU time.

share|improve this question
add comment

5 Answers 5

up vote 3 down vote accepted

What version of QEMU-KVM are you running?

We've seen this issue on versions 0.12.3 and down, but it doesn't seem to be too much of a problem on 0.12.4. Also, check to see if the screensavers are running. If you're using the VNC connection then it may be running there, and the CPU utilization won't be inside the VM - it will be used up by the KVM process.

share|improve this answer
    
0.12.3. I'll build in 0.12.4 and see if this goes away. –  Jeff Shattock May 31 '10 at 23:21
    
And indeed it did. Windows found a driver for a Qemu 0.12.4 Virtual CPU, and this problem is gone after a guest reboot. –  Jeff Shattock May 31 '10 at 23:47
add comment

I know that my answer comes after 100 years but: for future reference please see here:

http://forum.proxmox.com/threads/5770-Windows-guest-high-context-switch-rate-when-idle

If that is the casethen here is the solution: http://support.microsoft.com/kb/895980

It dropped my Win2K3 R2 guest cpu ussage (when guest was idle) on my x86_64 kvm host from ~30%-40% to 6%

share|improve this answer
    
The thread on Proxmox has a useful piece of information: remove the USB tablet virtual hardware from the windows VM will drop the number of context switches. My idle Windows VM went from 20ish% host CPU down to 5% host CPU. –  Colin 't Hart Sep 18 '12 at 8:47
add comment

The fact that Windows is freshly installed does not mean that is does not run background processes or services. Monitor the windows machine with SNMP or task manager and try to find out if it is indeed idle. As Massimo said you should also install pravirtualization drivers for your guest OS. I've never seen an idle VM to take CPU resources from the host.

share|improve this answer
add comment

I don't know anything at all about KVM, but on VMware this can happen if you don't install the VMware tools in the virtual machine, so that it doesn't have proper device drivers for the virtualized hardware and is unable to put its virtual CPU on real idle when it isn't actually doing anything, using a simple idle loop instead (which actually corresponds to the CPU being fully busy looping on itself).

Maybe there's something similar to VMware tools you should install in your VM?

share|improve this answer
add comment

First thing, stop comparing Windows and Linux or expecting them to behave the same. They are different.

Windows is never idle. It runs many background tasks and from my brief experience with Win 7 it does more of that than say XP. One thing that will help ease the load is to start shutting down necessary services, such as the indexing service.

share|improve this answer
    
Linux also runs many background "services". And the original poster confirmed that the Task Manager shows 1-2% CPU used in the Windows guest. –  Colin 't Hart Sep 18 '12 at 8:34
    
@Colin, as we all know, the Task Manager lies about CPU loads. Who here hasn't seen it report 98% idle and the system still be completely unresponsive with the CPU temperature because of the load? I'm also well aware that Linux also runs background tasks but the point I was making is that Linux and Windows are completely different animals. Those who try to compare one to the other will always struggle more than those who simply accept that they are different and treat each as a separate entity. –  John Gardeniers Sep 18 '12 at 12:55
    
That makes no sense at all. –  Colin 't Hart Sep 18 '12 at 20:36
    
@Colin, that's probably because this kind of thing is way out of your field. Any Windows who's been around for a while will understand what I wrote about the CPU load. Anyone who works with both Windows and Linux should understand the rest. As you don't work in the same field I don't really expect you to understand these things, just as I wouldn't understand anything Oracle. –  John Gardeniers Sep 18 '12 at 23:12
    
What makes you think I don't work in the same field? –  Colin 't Hart Sep 19 '12 at 11:03
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.