How to Enable Hyper-V Nested Virtualization in Windows 11

How to Enable Hyper-V Nested Virtualization in Windows 11 Leave a comment

Learn this information to find out about Hyper-V nested virtualization and allow and configure it in Home windows 11.

What’s Nested Virtualization?

Nested virtualization is a function of Hyper-V that enables putting in a Hyper-V position on a VM. If this function just isn’t enabled on a Hyper-V VM, the VM can’t be used as a Hyper-V host.

In easy phrases, nested Virtualization means turning a Hyper-V VM right into a hypervisor host that may host different VMs.

Necessities of Hyper-V Nested Virtualization

Nested virtualization helps Intel processors with EPT and VT-x know-how. Moreover, you’ll be able to configure this function on an AMD EPYC / Ryzen processor or increased.

To configure this Hyper-V function with a number on an Intel processor

  1. The Hyper-V host have to be working Home windows 10 or increased or Home windows Server 2016 and above
  2. The VM configuration model have to be 8.0 or increased

Alternatively, in case your Hyper-V host is working an AMD processor, these situations have to be met:

  1. The VM configuration model have to be 9.3 and above
  2. The host have to be working Home windows Server 2022 or later or Home windows 11 or later

Steps to Allow Nested Virtualization

Step 1: Test Hyper-V Host Specs

Within the final part, I defined the necessities to allow and use this function in Hyper-V. Step one is to verify in case your PC meets the processor necessities.

Particularly, the processor should help Intel VT-x or AMD. To discover ways to verify in case your PC’s processor helps these options, learn our guides – How to Enable Virtualization in Windows 11 or How to Enable Virtualization in Windows 10.

When you’ve enabled the processor virtualization function on the PC’s BIOS and put in the Hyper-V non-obligatory function, the final step is to verify the VM configuration model.

To study the supported digital machine configuration model to your Hyper-V Host, run PowerShell as administrator. Then, run the command beneath:

Get-VMHostSupportedVersion

The command lists all VM config variations your Hyer-V host helps and the default model set on the host. Once I ran the above command on my Home windows 11 PC with the Hyper-V non-obligatory function enabled, it returned the ends in the screenshot beneath.

Based mostly on the outcomes of the command, my Home windows 11 Hyper-V host’s default VM configuration model is 11.0. So, if I create a VM, on this host, its configuration model might be 11.

What this implies is that my Home windows 11 PC meets the necessities to allow nested virtualization.

Step 2: Create the VM and Set up Home windows

Use Hyper-V Supervisor to create a VM. Should you need assistance making a VM, observe the steps on this information Create a Generation 2 Hyper-V VM.

Alternatively, you’ll be able to run a modified model of this command:

New-VM -Title "HyperNVHost1" -MemoryStartupBytes 16GB -NewVHDPath C:Hyper-VVHDHyperNVHost1.vhdx -NewVHDSizeBytes 60GB -Era 2
Get-VM -Title "HyperNVHost1" | Set-VM -ProcessorCount 5
Get-VM -Title "HyperNVHost1" | Set-VMMemory -DynamicMemoryEnabled $false

The primary command creates a brand new VM whereas the second modifies the processor rely. In the meantime, the third command disables dynamic Reminiscence.
Change the VM’s identify, VHD path, and processor rely as required.

Since you may be utilizing this VM as a Hyper-V host, it’s endorsed to disable Dynamic Reminiscence. I like to recommend assigning a hard and fast reminiscence to the VM.

Step 3: Allow Nested Virtualization on the VM

Make sure that the brand new VM you created in Step 2 is off. Then, to allow nested virtualization, run the next PowerShell command on the Hyper-V host:

Set-VMProcessor -VMName "HyperNVHost1" -ExposeVirtualizationExtensions $true

To substantiate that the function has been enabled, run this command – it ought to return true:

Get-VMProcessor -VMName "HyperNVHost1" | Choose-Object ExposeVirtualizationExtensions

Step 3: Enable Nested Virtualization on the VM
Step 4: Set up Hyper-V on the Nested VM

To put in the Hyper-V function on the VM, register to the VM, open PowerShell, and run the command beneath:

I put in Home windows Server 2022 on the VM so the command beneath installs the Hyper-V function on the Server. As soon as you put in Hyper-V on the VM, it’s a Hyper-V host and you may create digital switches and VMs such as you would on a Bodily server working Hyper-V!

Set up-WindowsFeature -Title Hyper-V -IncludeManagementTools -Restart

Step 5: Allow MAC Deal with Spoofing on the VM’s vNIC

For the nested VMs to entry the “first” host’s exterior community, you’ll want to enable MAC address spoofing or configure Network Address Translation (NAT).

Enabling MAC tackle spoofing is quicker. To Allow this function on the “center” VM, run the command beneath.

Run the command on the primary (“first”) Hyper-V host. In my case, I’m working this command on my Home windows 11 PC. Change the placeholder, “<VMName>” to the identify of the VM.

Get-VMNetworkAdapter -VMName <VMName> | Set-VMNetworkAdapter -MacAddressSpoofing On

To substantiate that MAC tackle spoofing has been enabled, run the command beneath. As proven in my screenshot beneath the final command, MacAddressSpoofing needs to be “On.”

Get-VMNetworkAdapter -VMName <VMName> | Choose-Object MacAddressSpoofing

You may as well allow MAC Deal with spoofing from the VMs vNIC setting on Hyper-V Supervisor.

Should you haven’t created an Exterior Digital Swap on the “most important” Hyper-V host, create one. Then, hyperlink the nested VM’s vNIC to the swap.

To set the VM’s vNIC to the digital swap, open its properties, and choose the press the vNIC. Then, on the main points pane, click on the Digital Swap drop-down and choose the exterior swap.

Once you end, bear in mind to click on Apply > OK (Not proven on the screenshot beneath)


Step 7: Set up Hyper-V Function on the VM

The entire concept behind Nested Virtualization is to have the ability to use a Hyper-V VM as a Hyper-V Host. To put in Hyper-V on the VM you enabled this function, log in to the VM, and open PowerShell as administrator.

Then, run the command beneath:

Set up-WindowsFeature -Title Hyper-V -IncludeManagementTools -Restart

Step 8: Create a VM within the Hyper-V VM

Sign up to the Nested Virtualized VM (now a Hyper-V host) and create a VM.

  1. Open Hyper-V Supervisor from Server Supervisor: Instruments > Hyper-V Supervisor.

  1. Earlier than you create a VM, create an Exterior Digital Swap – open Digital Swap Supervisor.

  1. Then, give the Digital Swap a reputation, and choose “Exterior community” because the Connection kind. Because the VM has only one digital NIC, the vSwitch will use it for exterior connection.Once you end, click on OK to create the digital swap. You’ll obtain a warning about community interruption, click on Sure.

After creating the Digital Swap, assign an IP to it by opening its TCP/IP properties. When you have DHCP, the swap might be assigned an IP tackle mechanically.

  1. Subsequent cease, create a VM: right-click the Hyper-V host’s identify, level to New, and choose Digital Machine.

Observe these screenshots to create the brand new VM:

Follow these screenshots to create the new VM - step 1Follow these screenshots to create the new VM - step 2Follow these screenshots to create the new VM - step 3Follow these screenshots to create the new VM - step 4
Follow these screenshots to create the new VM - step 5Follow these screenshots to create the new VM - step 6Follow these screenshots to create the new VM - step 7Follow these screenshots to create the new VM - step 8

Step 9: Set up Working System on the New VM

Now we have to set up OS on the brand new VM we created in our Hyper-V VM. However, wait a minute, how do we offer the ISO picture?

The best approach is to repeat the ISO picture to an exterior USB drive.

  1. Then, observe the steps in my information – How to Access an External USB Drive from a Hyper-V VM – to mount the USB drive on the primary VM (the VM you enabled Nested Virtualization).

Once you mount the USB drive on the primary VM (now performing as a Hyper-V host), convey it on-line through the VM’s Disk Administration.

  1. Then, open the Settings of the second VM (from Hyer-V Supervisor), and choose SCSI Controller > DVD Drive > Add.

  1. On the main points pane of the DVD drive, choose “Picture file:” Then, use the Browse button to open the ISO picture file on the USB drive. Click on Apply (I didn’t present the Apply button in my screenshot).

  1. Lastly, click on Firmware, then on the main points pane, use the Transfer Up button to make DVD Drive the primary boot gadget, and click on Apply if you end.Then, begin the VM and set up the OS.

Should you’re putting in a Home windows OS, earlier than you click on Begin, get able to press any key to begin the set up. Then, observe the wizard to finish the set up.


When the OS is put in, in case your community has a DHCP server, it ought to decide up an IP tackle.

Conclusion

Nested Virtualization is working Hyper-V on a VM. In my screenshot beneath, the VM Ilabelled (1) is working on my Home windows 11 Hyper-V.

In the meantime, the second VM (2) is on the primary VM.

I hope you had been as excited studying this information as I used to be writing it!

Nested Virtualization offers a terrific alternative to construct a Hyper-V cluster utilizing a laptop computer working Home windows 11. Based mostly on this information, I might be writing a 7-part sequence of articles titled Migrate VMware to Hyper-V.

Thanks once more for studying my article. Let me know your ideas by responding to the “Was this web page useful?” query beneath.

답글 남기기