Ok, we all know (or should know) that Microsoft's answer is a plain "NO!".

But we also know that recent hypervisors can support nested/recursive virtualization, provided the underlying CPU offers hardware virtualization; VMware's recent products (ESXi 5, Workstation 8) even support this natively, without the need for ugly hacks.

So, my question is: can Hyper-V run succesfully (i.e. allowing to actually run virtual machines) inside other hypervisors?

If yes, which ones? And how?

This is only intended for testing, of course.

  • possibly within kvm/HVM or xen_pv, but why would you want to, its just asking for pain – anthonysomerset Oct 18 '11 at 17:40
  • 1
    e.g. for testing purposes. – Mircea Vutcovici Oct 18 '11 at 17:46
  • I know it's been done with ESXi as Hyper-V parent, but it's ugly slow. Sorry, don't have a link to directions. – Chris S Oct 18 '11 at 18:00
  • What kind of a test would actually be valid in this environment? – Jake Oshins Oct 18 '11 at 19:58
  • 2
    In order to set up a test Hyper-V cluster, you need at least three physical servers; that's usually not something you can get your hands on easily. – Massimo Oct 18 '11 at 20:00

Yes, it can, if the underlying CPUs support the latest virtualization extensions (Intel VT-X/EPT) and if you're using the latest VMware products (Workstation 8, ESXi 5).

The relevant settings in your VM should be as follows:

monitor.virtual_mmu = "hardware"
monitor.virtual_exec = "hardware"
vhv.enable = "TRUE"
hypervisor.cpuid.v0 = "FALSE"

The first three settings can be enabled via GUI (where exactly varies slightly between Workstation and ESXi), the last one needs to be manually added to the VM's .vmx file.

Additionally, on ESXi 5, you need to add the following line to /etc/vmware/config:

vhv.allow = "TRUE"
| improve this answer | |
  • Was this found by trial and error or can you point us to the source, which might have more information of interest to those considering doing the same? – John Gardeniers Oct 19 '11 at 9:58
  • There are various sources on the web, all confirming the same steps and settings; nothing official, though, neither from VMware nor from Microsoft (which still says this is not possible at all). – Massimo Oct 19 '11 at 10:39

There are different answers to this question.

Before WS2016/W10, the correct answer was: Yes, you can enable the Hyper-V role in a Hyper-V VM, but the hypervisor would not start. Therefore, you could create VMs in the vHost, but those VMs could not start.

However, in Windows 10 and WS2016 (TP4 and later) we can use nested Hyper-V. If you're mad enough to try, you can create a host, in a host, in a host, in a host, on a host ...

| improve this answer | |
  • Wow, that's actually true, Microsoft finally managed to support nested virtualization: msdn.microsoft.com/en-us/virtualization/hyperv_on_windows/…. Wonder if it allows hosting ESX/i inside Hyper-V, too... – Massimo Feb 1 '16 at 20:56
  • @Massimo from your link - "Both hypervisors need to be the latest Windows Insider build (10565 or greater). Other hypervisors will not work." (Aside: One reason Microsoft had to make nested Hyper-V work is for Server 2016's container support to be usable in VMs; one of the container types is a Hyper-V based container. Another reason might be the Virtual Secure Mode in Windows 10 Enterprise which keeps passwords in a Hyper-V VM, and runs the main OS in another). – TessellatingHeckler Feb 2 '16 at 0:20
  • @TessellatingHeckler Aside from what Microsoft might say, Hyper-V had been happily able to run inside VMware products for a while (although of course nobody officially supported it ever); this Hyper-V nesting is based on the same underlying principles, thus I'd guess it would make Hyper-V able to run other nested hypervisors too (although, again, without any kind of official support). – Massimo Feb 2 '16 at 0:30

To complete the previous answer. According to this question and Michael H. comments, ESXi is currently the only option to run Hyper-V within a VM.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.