Enable or disable Nested Virtualization for VMs in Hyper-V

Nested Virtualization is supported both Azure and on-premises with the following prerequisites;

Intel processor with VT-x and EPT technology

  • The Hyper-V host must be Windows Server 2016/Windows 10 or greater
  • VM configuration version 8.0 or greater

AMD EPYC/Ryzen processor or later

  • The Hyper-V host must be Windows Server 2022/Windows 11 or greater
  • VM configuration version 10.0 or greater

For both configurations, the guest can be any Windows-supported guest operating system. Keep in mind that newer Windows operating systems may support enlightenments that improve performance.

To enable Nested Virtualization for VMs in Hyper-V, do the following:

  • Create a virtual machine using the prerequisites specified above.
  • While the virtual machine is in the OFF state, on the physical Hyper-V Windows host, open PowerShell in elevated mode.
  • In the PowerShell console, run the command below to enable nested virtualization for the virtual machine. Substitute the <VMName> place holder with the actual VM name for the VM you created earlier.
Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true
  • Once the command executes, you can exit PowerShell console.
  • Next, start the virtual machine.
  • After the VM starts, install Hyper-V within the virtual machine, just like you would for a physical machine.
Disable Nested Virtualization

You can disable nested virtualization for a stopped virtual machine. To disable Nested Virtualization for VMs in Hyper-V, do the following:

  • Open PowerShell in elevated mode on the physical Hyper-V Windows host.
  • In the PowerShell console, run the command below:
Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $false
  • Exit PowerShell once the command executes.

Create a Hyper-V Virtual Machine shortcut in Windows 11/10

hyperv

To create Hyper-V Virtual Machine Desktop Shortcut in Windows 11/10, do the following:

  • Right-click or press and hold on an empty area on the Desktop.
  • Click New > Shortcut.
  • In the Type the location of the item: field, type in the following, and replace the <VMName> in the target with the actual VM name you want to create the desktop shortcut for.
vmconnect.exe localhost "<VMName>"
  • Next, in the Type a name for this shortcut: field, specify a name you want for the shortcut.
  • Click Finish.
  • Now, right-click on the shortcut.
  • Select Properties from the context menu.
  • In the Shortcut tab, click the Advanced button.
  • Check the Run as administrator option.
  • Click OK > OK.

Enable Hyper-V in Windows 10/11 Home Edition

Win10_Optional_Features

1. Download Hyper-V Enabler from here:

https://mega.nz/file/25xCEKoR#-THHAI15pJREGPdlIRBvJgvXVnH-mFkBGMwL39XmN_Y

2. Once downloaded, right-click on the file and select Run as Administrator. This will trigger the installation script. It may take some time to complete the installation. Please let it complete without interruption.

3. Once complete, press Y to continue. The system will restart.

4. You will see the Windows updates screen upon restart.

5. After restarting, you can check if the Hyper-V option is visible in Windows Optional Features. To check, go to Run –> optionalfeatures. You will find Hyper-V and Hyper-V Management tools.

You can search for Hyper-V in the start menu to start creating virtual machines on your Windows 10 Home computer.

Disable Hyper-V from Windows 10 Home

If you don’t want this functionality in your computer, you can always disable it. There are two ways to disable:

  1. Go to Run –> optionalfeatures. This will open the Optional Features window.
  2. Uncheck Hyper-V and Hyper-V management tools.
  3. Restart the computer.

You can also do this using the command-line:

PowerShell

Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

Command Prompt

DISM /Online /Disable-Feature /All /FeatureName:Microsoft-Hyper-V

Native Boot Windows 11 Virtual Hard Disk (VHDX)

Win11_White

Native Boot allows you to create a virtual hard disk (VHDX), install Windows to it, and then boot it up, either on your PC side-by-side with your existing installation, or on a new device.

A native-boot VHDX can be used as the running operating system on designated hardware without any other parent operating system. This differs from a scenario where a VHDX is connected to a virtual machine on a computer that has a parent operating system.

Native boot for Windows 11 requires the .vhdx format, not the .vhd format.

VHDXs can be applied to PCs or devices that have no other installations of Windows, without a virtual machine or hypervisor. (A hypervisor is a layer of software under the operating system that runs virtual computers.) This enables greater flexibility in workload distribution because a single set of tools can be used to manage images for virtual machines and designated hardware.

This tutorial will show you how to boot a Windows 11 VHDX file natively to dual boot with Windows 10 or Windows 11.

Note: You must be signed in as an administrator to setup and Native Boot a Windows 11 VHDX file.
The Windows 11 VHDX file used in this tutorial was created with a Hyper-V Windows 11 virtual machine, and copied to the OS to dual boot with.

Here’s How:

1 Copy the Windows 11 VHDX file where you want to keep it saved at to the Windows OS you want to dual boot with.

2 Open Disk Management (diskmgmt.msc).

3 In Disk Management, click/tap on Action on the menu bar, and click/tap on Attach VHD.

4 Perform the following steps to select the Windows 11 VHDX file to attach: (see screenshot below)

  • Click/tap on Browse.
  • Navigate to and select the VHDX file.
  • Click/tap on Open.
  • Click/tap on OK.

5 Right click on the middle “Healthy (Basic Data Partition)” for the attached VHDX, and click/tap on Change Drive Letter and Paths. (If a drive letter has already been assigned to the attached Windows 11 VHDX, then jump to step 8 instead.)

6 Click/tap on Add.

7 Select (dot) Assign the following drive letter, select an available drive letter (ex: “F”) you want to assign, and click/tap on OK.

8 The Windows 11 VHDX file will now be mounted as a drive with the drive letter (ex: “F”) you selected to assign to it.

9 You can now close Disk Management if you like.

10 Open an elevated Windows Terminal, and select Command Prompt.

11 Type the command below you want to use into the elevated command prompt, and press Enter.

(Keep current OS default at boot)
bcdboot <drive letter>:\Windows /d

OR

(Make VHDX the default OS at boot)
bcdboot <drive letter>:\Windows

This command will add the attached Windows 11 VHDX to the boot manager to dual boot.
Substitute <drive letter> in the command above with the actual drive letter (ex: “F”) of the attached Windows 11 VHDX.
For example: bcdboot F:\Windows

12 You can now close the elevated command prompt. The next time you boot or restart the computer, you can select to boot from Windows 11 (VHDX) or Windows 10 (installed OS).

Install Hyper-V on Windows 11 Home

Win11_Grey

1. Select the text below and store as text in a file called HyperV.bat and save on desktop (or any location you prefer)

2. Ensure your bios is set to enable virtualisation.

3. Run HyperV.bat with admin rights

pushd "%~dp0"

dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >c:\users\public\hyper-v.txt

for /f %%i in ('findstr /i . c:\users\public\hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"

del c:\users\public\hyper-v.txt

Dism /online /enable-feature /featurename:Microsoft-Hyper-V -All /LimitAccess /ALLpause