If KVM is a Type 1 hypervisor, what is VirtualBox?

A 5 star hangout for overworked and underpaid system admins.
Post Reply
dizwell
Posts: 29
Joined: 2006/03/16 22:27:28
Contact:

If KVM is a Type 1 hypervisor, what is VirtualBox?

Post by dizwell » 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?)

takeawaydave
Posts: 25
Joined: 2013/08/30 11:28:32

Re: If KVM is a Type 1 hypervisor, what is VirtualBox?

Post by takeawaydave » 2016/12/22 07:49:02

Comes down to features and scalability. KVM is targeting large enterprises that required to be running there own private clouds with all the required security and features such as clustering and live migration.

dizwell
Posts: 29
Joined: 2006/03/16 22:27:28
Contact:

Re: If KVM is a Type 1 hypervisor, what is VirtualBox?

Post by dizwell » 2016/12/23 01:13:45

Thanks, but that's begging the question, I think. Restating it: if KVM is classed as a type 1 because it's accessing the VT-x or AMD-V CPU extensions, why isn't VirtualBox called a Type 1 hypervisor when you can select to do the same thing? (Only assuming that VirtualBox can be called a Type 1 does the question then arise about why you'd chose one over the other. It's the assumption I'm really asking about, I suppose).

(Source for claim that VirtualBox is a Type 2: https://en.wikipedia.org/wiki/Hypervisor. Source for claim that KVM is 'really' a type 1: https://www.ibm.com/developerworks/comm ... or?lang=en)

Post Reply