HowTo: Run Hyper-V/Docker on Hyper-V Virtual Machine

If you are like me, you may run all your Dev Environments from within Virtual Machines, leaving your base OS install as clean as possible.

For a private project I want to run Docker inside a Hyper-V machine. So question is.. is it possible to run Hyper-V running on a VM?

Short Answer: Yes, it’s possible!

Prerequisites

  • A Hyper-V host running Windows Server 2016 or Windows 10 Anniversary Update;
  • A Hyper-V VM running Windows Server 2016 or Windows 10 Anniversary Update;
  • A Hyper-V VM with configuration version 8.0 or greater;
  • An Intel processor with VT-x and EPT technology.

Configure Nested Virtualisation

  1. Create a virtual machine.
  2. While the virtual machine is in the OFF state, run the following command on the physical Hyper-V host. This enables nested virtualisation for the virtual machine.
  3. Start the virtual machine.
  4. Install Hyper-V within the virtual machine, just like you would for a physical server.