If KVM is a Type 1 hypervisor, what is VirtualBox?
Posted: 2016/12/22 00:03:35
So I understand the distinction between Type 1 and Type 2 hypervisors: basically, if the hypervisor has direct access to physical hardware, it's type 1; and if access to the physical hardware is mediated through an operating system, it's Type 2. Also, I guess, Type 1s are not very end-user-friendly, but perform well; and Type 2s are usually quite end-user-friendly, but suffer a bit in the relative performance stakes.
So then the KVM guys get upset if you call their hypervisor a Type 2 (since it runs 'inside' an operating system). They will claim that since it sits in the linux kernel, and since it mediates access to the physical VT-x or AMD-V CPU extensions, anything running via KVM is actually running directly on the physical CPU, and that makes it a Type 1.
And I bought that argument, and I was happy with it.
Until I remembered that for a VirtualBox VM, under System -> Acceleration, there's a checkbox that says "Enable VT-x/AMD-V". Now, if that's checked, surely my VirtualBox VM is now doing exactly what it would have done under KVM: it will now have direct access to the virtualization extensions on the CPU? And if we say that KVM is a Type 1 hypervisor when it does that, surely VirtualBox should therefore also be called a Type 1 hypervisor?
Can someone explain whether enabling that option for a VirtualBox VM *does* actually mean that your VM ends up running with the same sort of physical hardware acceleration as would apply under KVM? And in that case, is it fair to claim KVM is a Type 1, but say that VirtualBox is a Type 2?
Bottom line question, I guess: why would (or should) I run KVM instead of, say, VirtualBox if both end up doing exactly the same sort of Type 1-a-like hardware acceleration? (Given that KVM's front-ends are not exactly as polished as VB's?)
So then the KVM guys get upset if you call their hypervisor a Type 2 (since it runs 'inside' an operating system). They will claim that since it sits in the linux kernel, and since it mediates access to the physical VT-x or AMD-V CPU extensions, anything running via KVM is actually running directly on the physical CPU, and that makes it a Type 1.
And I bought that argument, and I was happy with it.
Until I remembered that for a VirtualBox VM, under System -> Acceleration, there's a checkbox that says "Enable VT-x/AMD-V". Now, if that's checked, surely my VirtualBox VM is now doing exactly what it would have done under KVM: it will now have direct access to the virtualization extensions on the CPU? And if we say that KVM is a Type 1 hypervisor when it does that, surely VirtualBox should therefore also be called a Type 1 hypervisor?
Can someone explain whether enabling that option for a VirtualBox VM *does* actually mean that your VM ends up running with the same sort of physical hardware acceleration as would apply under KVM? And in that case, is it fair to claim KVM is a Type 1, but say that VirtualBox is a Type 2?
Bottom line question, I guess: why would (or should) I run KVM instead of, say, VirtualBox if both end up doing exactly the same sort of Type 1-a-like hardware acceleration? (Given that KVM's front-ends are not exactly as polished as VB's?)