# Nested virtualization on FreeBSD?



## nekoexmachina (Feb 12, 2015)

Hello.
Is there any way to run KVM-based VM under virtualization software, running on freebsdFreeBSD host?
From what I know, VirtualBox and qemu can't do this, and VMware can.
Does bhyve do this currently?


----------



## mmediouni (Feb 12, 2015)

I don't think that you can do that. But Xen works quite well][(and needs a small NetBSD dom0 currently).


----------



## usdmatt (Feb 12, 2015)

I believe it should be possible to run Linux+KVM under bhyve, as KVM can run on machines that don't have hardware virtualisation features (i.e. VT-x). I'm not 100% certain but I'm sure I've seen posts from a user running Openstack under bhyve.

bhyve has taken the line of not supporting anything other than hardware virtualisation, which I personally agree with, so will only run if virtualisation extensions are present. At the moment bhyve does not emulate VT-x (or the AMD equivalent) in the guest, so you can't run bhyve-in-bhyve. I think the devs have looked at emulating the relevant features but I don't think it's a high priority as there really isn't that much of a production use case for running nested virtualisation (seems purely a 'hobbyist' thing to me).


----------



## grehan@ (Feb 13, 2015)

I've run Xen 4.3 on top of bhyve with a NetBSD dom0. This is PV Xen since as usdmatt mentioned, bhyve doesn't (yet) support VT-x emulation, so can only run PV guests.

Speaking of which, nested virt aka VT-x emulation is on the roadmap for bhyve, but is a decidedly non-trivial task.


----------

