Guide

Build a VM that can run Hyper-V

Hyper-V can run inside a virtual machine. That lets you build and test a Hyper-V host, or a whole cluster, without buying servers. The VM needs three settings that a normal VM does not.

10 minutesRun as administrator on the Hyper-V host
What improves

You can build and test a Hyper-V host or cluster without buying servers.

Why it matters

A normal VM cannot run Hyper-V, so the role refuses to install until three settings are changed.

How you do it

Create the VM with fixed memory, expose the virtualisation extensions and install Windows Server.

What you need

  • A host with an Intel processor, or an AMD processor on Windows 11 or Windows Server 2022 and later.
  • Enough memory to give the VM a fixed amount. This guide uses 8 GB.
  • A Windows Server installer image.
For learning and testing

Running Hyper-V inside a VM is slower than on real hardware. Use it to practise and to test changes, not to run a school's servers.

Create the VM

Hyper-V host
$vm   = 'CON-HV-01'
$root = 'D:\VMs'
$iso  = 'D:\ISOs\WindowsServer2025.iso'

New-VM -Name $vm -Generation 2 -MemoryStartupBytes 8GB -Path $root `
    -NewVHDPath "$root\$vm\Virtual Hard Disks\$vm.vhdx" -NewVHDSizeBytes 80GB -SwitchName 'CON-LAN' | Out-Null
Set-VM -Name $vm -ProcessorCount 4 -StaticMemory -CheckpointType Disabled -AutomaticStopAction ShutDown

Let the VM run Hyper-V

This passes the processor's virtualisation features through to the VM. The VM must be off when you set it.

Hyper-V host
Set-VMProcessor -VMName $vm -ExposeVirtualizationExtensions $true
SettingWhy
ExposeVirtualizationExtensionsWithout it, the Hyper-V role refuses to install inside the VM.
Fixed memoryA VM that runs Hyper-V cannot use dynamic memory.
Checkpoints offRolling a host back in time confuses the VMs running on it.
4 processorsThe VM runs Windows, Hyper-V and its own VMs. Processors are shared with the host, not reserved.

Attach the installer and install Windows Server

Hyper-V host
Add-VMDvdDrive -VMName $vm -Path $iso
Set-VMFirmware -VMName $vm -FirstBootDevice (Get-VMDvdDrive -VMName $vm)
Start-VM $vm
vmconnect localhost $vm

Press a key when asked to start from the DVD. Choose an edition with (Desktop Experience) if you want the normal Windows desktop. Datacenter is the edition Hyper-V hosts normally run.

Check it

Hyper-V host
Get-VM $vm | Format-Table Name, Generation, ProcessorCount, @{n='RAM_GB';e={$_.MemoryStartup/1GB}}, CheckpointType -AutoSize
Get-VMProcessor -VMName $vm | Format-Table VMName, ExposeVirtualizationExtensions -AutoSize

ExposeVirtualizationExtensions should read True.

Network for the VMs inside

VMs that run inside this VM send traffic with their own hardware addresses. Hyper-V blocks that unless you allow it on the cards they use. The next guide adds those cards.

Done when

Check

The VM has fixed memory, checkpoints off and virtualisation extensions exposed, and Windows Server is installed.

Your progress is kept in this browser only.