Windows Server 2025 / How to Create a Generation 2 Hyper-V VM

For a new Windows Server 2025 test VM, select Generation 2, attach a new VHDX and official ISO, then install the guest. Generation cannot be changed after creation, so confirm guest and boot compatibility first.

Prepare a separate test machine

Use HV1 with Hyper-V and Lab-Private. Create HVTEST01 rather than recreating DC1 or FS1. Prepare management rights, the ISO, and enough storage. Example allocations are 2 vCPUs, 4 GB startup memory, and a 60 GB OS disk; they are lab choices, not universal requirements.

Budget simultaneous guests and the host. Generation 2 provides UEFI and supported Secure Boot, but a VHDX file alone does not make an older BIOS installation UEFI-compatible. Check generation selection guidance.

Review the New Virtual Machine wizard

  1. On HV1, choose New → Virtual Machine.
  2. Use HVTEST01 and a folder separate from existing VM files.
  3. Select Generation 2.
  4. Assign 4096 MB startup memory, initially fixed for a simple comparison.
  5. Choose Lab-Private.
  6. Create HVTEST01-OS.vhdx with 60 GB capacity.
  7. Select the actual Windows Server 2025 ISO.
  8. Compare generation, paths, memory, and switch before finishing.

Set two virtual processors afterward and use the appropriate Windows Secure Boot template. A dynamic disk’s maximum capacity differs from its current host size. The official VM creation guide covers GUI and PowerShell.

Use the complete PowerShell alternative

Run only before GUI creation, in an elevated HV1 shell. Supply the real existing VM-root folder and ISO. Existing VM names and folders stop the example:

$vmName = 'HVTEST01'
$vmRoot = Read-Host 'Existing folder for virtual machines'
$isoPath = Read-Host 'Full path of the Windows Server 2025 ISO'
if (-not (Test-Path -LiteralPath $vmRoot -PathType Container)) { throw 'VM root not found' }
if (-not (Test-Path -LiteralPath $isoPath -PathType Leaf)) { throw 'ISO not found' }
if (Get-VM -Name $vmName -ErrorAction SilentlyContinue) { throw 'VM name already exists' }
Get-VMSwitch -Name 'Lab-Private' -ErrorAction Stop | Out-Null
$vmFolder = Join-Path $vmRoot $vmName
if (Test-Path -LiteralPath $vmFolder) { throw 'VM folder already exists' }
New-Item -ItemType Directory -Path $vmFolder | Out-Null
New-VM -Name $vmName -Generation 2 -MemoryStartupBytes 4GB -Path $vmRoot -NewVHDPath (Join-Path $vmFolder 'HVTEST01-OS.vhdx') -NewVHDSizeBytes 60GB -SwitchName 'Lab-Private'
Set-VMProcessor -VMName $vmName -Count 2
Set-VMMemory -VMName $vmName -DynamicMemoryEnabled $false
Add-VMDvdDrive -VMName $vmName -Path $isoPath
$dvd = Get-VMDvdDrive -VMName $vmName
Set-VMFirmware -VMName $vmName -FirstBootDevice $dvd
Get-VM -Name $vmName | Select-Object Name,Generation,State,ProcessorCount

Verify Generation 2, Off state, and processor count. If a command fails partway through, inspect what was created before rerunning. Do not delete an existing VHDX to bypass an error.

Boot the ISO and install the guest

  1. Open VMConnect, start HVTEST01, and respond to the media boot prompt.
  2. Choose language and keyboard settings.
  3. Select the intended edition and Desktop Experience if following graphical instructions.
  4. Check that the target is the new 60 GB virtual disk; detach unrelated data disks first.
  5. Complete setup, set Administrator credentials, and sign in.

If setup starts again after a restart, boot the installed disk or detach the ISO. For PXE-only boot, inspect ISO attachment, DVD order, and media compatibility rather than disabling security features indiscriminately.

Verify the guest and its isolation

Check OS and installation option inside the guest, and VM state and assigned resources on the host. Without DHCP on the Private switch, absent automatic addressing is not OS installation failure.

Keep HVTEST01 as a standalone workgroup guest for resource, checkpoint, and export exercises. No domain join or controller role is required. For later cleanup, preserve needed guest files and distinguish removing VM registration from deleting disk files.