Do you know what you can run hypervisor within the virtual machine that is hosted on the hypervisor? Yes, it is possible. It doesn’t work by default, but you’ll need to do some configuration on our Hyper-V, VMware or XenServer.
In order to do it on Hyper-V Server, Microsoft recommends that Hyper-V host and guest are running Windows 10 or Windows Server 2016 and later, VM configuration version 8.0 or greater and Intel CPU with VT-X (x86 virtualization) and SLAT (Second Level Address Translation) technology. Currently, it is not supported on AMD CPUs. Please note that you can run your Hyper-V with AMD CPU, but you can’t do nested virtualization.
In all my cases I was using nested virtualization for testing purposes such as deploying and testing clustered Hyper-V environment. It is not recommended to run nested virtualization for productive machines and services.
If nested virtualization is not enabled, you’ll see error as shown in the screenshot below.
The procedure of enabling nested virtualization for specific VM is straightforward. In my case I want to enable nested virtualization on my VM: Windows Server 2019. So, let’s start it.
- Shutdown your virtual machine
- Run PowerShell as administrator and type the following command and press Enter
Set-VMProcessor win-srv-2019 -ExposeVirtualizationExtensions $true
where win-srv-2019 is the name of virtual machine.
- Start your virtual machine
- Open Server Manager
- Click Install roles and features
- Install Hyper-V Server
Thank you for reading this article. In case of any questions, feel free to comment or contact me.