Hyper-V Nested Virtualisation

Hyper-V Nested Virtualization is a feature that allows running Hyper-V inside a Hyper-V virtual machine. This enables running virtual machines on a virtual machine, which can be useful for testing, development, or training scenarios.

To use Hyper-V Nested Virtualization, the following prerequisites are required:

  1. The Hyper-V host must be running Windows Server 2016 or later or Windows 10 Pro or Enterprise version 1709 or later.
  2. The Hyper-V host must have at least 4 GB of RAM.
  3. The virtual machine must be running Windows Server 2016 or later or Windows 10 Pro or Enterprise version 1709 or later.
  4. The virtual machine must have at least 4 GB of RAM.
  5. The virtual machine must be configured with at least 2 virtual processors.
  6. The Hyper-V host and virtual machine must have the Nested Virtualization feature enabled.

Here are the steps to create and configure a Hyper-V host with Nested Virtualization:

  1. Enable the Hyper-V role on the host by opening the Server Manager, selecting Add Roles and Features, and then selecting the Hyper-V role.
  2. Create a virtual switch that will be used by the virtual machine that will host the nested virtual machines.
  3. Create a virtual machine on the Hyper-V host and install an operating system that meets the requirements for nested virtualization.
  4. Enable the Nested Virtualization feature on the virtual machine by running the following PowerShell command:Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $trueReplace <VMName> with the name of the virtual machine.
  5. Start the virtual machine and install the Hyper-V role.
  6. Create and configure virtual machines inside the nested Hyper-V virtual machine.

It’s important to note that there are two generations of virtual machines in Hyper-V: Generation 1 and Generation 2. Generation 1 virtual machines are designed to support legacy operating systems, while Generation 2 virtual machines are optimized for modern operating systems. Nested virtualization is supported only on Generation 2 virtual machines.

Additionally, there are different versions of the Hyper-V virtual machine configuration file, which define the capabilities and features that are available to the virtual machine. The version of the configuration file depends on the version of Hyper-V that is used to create the virtual machine. To enable nested virtualization, the virtual machine must be running configuration version 8.0 or later.

In summary, Hyper-V Nested Virtualization is a powerful feature that allows running virtual machines inside a virtual machine. This can be useful for testing, development, or training scenarios. To use Nested Virtualization, the Hyper-V host and virtual machine must meet certain requirements, and the feature must be enabled. Once enabled, virtual machines can be created and configured inside the nested Hyper-V virtual machine.

Author: tonyhughes