How it works...
It works on modern computers by taking advantage of CPU features, for the most part.
When you emulate your hardware, using either VirtualBox or KVM, what you're really doing is creating a whole separate set of instructions for the CPU to process. If we emulate VMs on top of CPUs that aren't aware of them natively, and can't deal with their instructions at near-native speeds, you have to emulate even the CPU, which can be costly and slow (more on this later).
Generally, CPUs from the last decade will have either AMD-V (in the case of AMD) or VT-x (in the case of Intel), which means that your VMs will be nearly indistinguishable from your host machine in terms of raw processing speed.
There's also full virtualization and paravirtualization ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access