I was running Debian in a QEMU instance, and everything was running extremely slowly. I understand why emulating different instruction sets is slow (you have to translate each instruction to a form executable on the host architecture), but why are emulators so slow when both the host and guest are running on the same architecture (x86, in this case)? The instruction sets are exactly the same, so surely there isn't anything that needs to be translated, right? So what specific operation causes the guest OS to run so slowly? Am I missing something or not understanding something here?
Asked
Active
Viewed 1,030 times
1
-
im no expert here. i think its due to you have to mimic an entire chipset and its firmware here. imagine a simple bios interrupt instruction to read out disks, in a vm you dont want this instruction to execute since it would try to read from the host, you have to intercept that and act as if it was actually executed, by actually interpreting every single instruction. with hardware virtualization you can do io and memory remapping at hatdware level which should bring you a mayor performqnce boost – fassl Jul 06 '16 at 19:46
-
The usual reason for slowness in this case is that you've forgotten to pass --enable-kvm to QEMU, which is the option you need to request use of the hardware virtualization to speed things up. Otherwise we will default to emulation, and we don't attempt to special case same-guest-same-host. – Peter Maydell Jul 29 '16 at 16:21