Docs / Windows Server / Run Hyper-V Nested Virtualization on Windows Server VPS

Run Hyper-V Nested Virtualization on Windows Server VPS

By Admin · Mar 15, 2026 · Updated Apr 24, 2026 · 249 views · 3 min read

Nested virtualization allows you to run Hyper-V inside a virtual machine, enabling scenarios like development labs, container hosting, and testing environments on your Windows Server VPS. This guide covers enabling and using nested Hyper-V on your Kazepute Windows Breeze.

Prerequisites

  • VPS must support nested virtualization — the host hypervisor must expose virtualization extensions
  • Windows Server 2022 or later recommended
  • Minimum 8GB RAM (16GB+ recommended for running VMs inside VMs)
  • Processor with VT-x/AMD-V exposed to the VM

Check Nested Virtualization Support

# Check if virtualization extensions are available
systeminfo | findstr /i "Hyper-V"

# PowerShell check
Get-ComputerInfo | Select-Object HyperVisorPresent, HyperVRequirementVirtualizationFirmwareEnabled

# Check processor features
(Get-WmiObject Win32_Processor).VirtualizationFirmwareEnabled

# If you see "A hypervisor has been detected" — nested virt is supported

Install Hyper-V Role

# Install Hyper-V with management tools
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart

# After reboot, verify
Get-WindowsFeature Hyper-V
Get-VMHost | Select-Object Name, LogicalProcessorCount, MemoryCapacity

Configure Hyper-V Networking

# Create virtual switch
# Internal — VMs can communicate with each other and the host
New-VMSwitch -Name "InternalSwitch" -SwitchType Internal

# NAT — VMs get internet through NAT
New-VMSwitch -Name "NATSwitch" -SwitchType Internal
$ifIndex = (Get-NetAdapter | Where-Object Name -like "*NATSwitch*").ifIndex
New-NetIPAddress -IPAddress 172.16.0.1 -PrefixLength 24 -InterfaceIndex $ifIndex
New-NetNat -Name "NATNetwork" -InternalIPInterfaceAddressPrefix "172.16.0.0/24"

# External — bridges to the host network (use with caution on VPS)
# New-VMSwitch -Name "ExternalSwitch" -NetAdapterName "Ethernet" -AllowManagementOS $true

Create Virtual Machines

# Create VM storage
New-Item -ItemType Directory -Path "D:\VMs", "D:\ISOs" -Force

# Download an ISO (example: Ubuntu Server)
Invoke-WebRequest -Uri "https://releases.ubuntu.com/24.04/ubuntu-24.04-live-server-amd64.iso" `
    -OutFile "D:\ISOs\ubuntu-24.04.iso"

# Create a VM
$vmName = "TestVM-Ubuntu"
New-VM -Name $vmName `
    -MemoryStartupBytes 2GB `
    -Generation 2 `
    -NewVHDPath "D:\VMs\$vmName\disk.vhdx" `
    -NewVHDSizeBytes 40GB `
    -SwitchName "NATSwitch"

# Configure VM
Set-VM -Name $vmName `
    -ProcessorCount 2 `
    -DynamicMemory `
    -MemoryMinimumBytes 1GB `
    -MemoryMaximumBytes 4GB `
    -AutomaticStartAction Start `
    -AutomaticStopAction ShutDown

# Disable Secure Boot for Linux VMs
Set-VMFirmware -VMName $vmName -EnableSecureBoot Off

# Attach ISO
Add-VMDvdDrive -VMName $vmName -Path "D:\ISOs\ubuntu-24.04.iso"

# Set boot order (DVD first for installation)
$dvd = Get-VMDvdDrive -VMName $vmName
Set-VMFirmware -VMName $vmName -FirstBootDevice $dvd

# Start the VM
Start-VM -Name $vmName

# Connect to VM console
vmconnect localhost $vmName

Create Windows VMs

# Create a Windows Server VM
$vmName = "TestVM-WinServer"
New-VM -Name $vmName `
    -MemoryStartupBytes 4GB `
    -Generation 2 `
    -NewVHDPath "D:\VMs\$vmName\disk.vhdx" `
    -NewVHDSizeBytes 60GB `
    -SwitchName "NATSwitch"

Set-VM -Name $vmName -ProcessorCount 4 -DynamicMemory

# Enable nested virtualization INSIDE the VM
Set-VMProcessor -VMName $vmName -ExposeVirtualizationExtensions $true

# Enable MAC address spoofing (needed for nested networking)
Set-VMNetworkAdapter -VMName $vmName -MacAddressSpoofing On

# Attach Windows ISO and start
Add-VMDvdDrive -VMName $vmName -Path "D:\ISOs\WindowsServer2022.iso"
Start-VM -Name $vmName

VM Management

# List all VMs
Get-VM | Format-Table Name, State, CPUUsage, MemoryAssigned, Uptime

# Checkpoint (snapshot) management
Checkpoint-VM -Name "TestVM-Ubuntu" -SnapshotName "Pre-Update"
Restore-VMCheckpoint -Name "Pre-Update" -VMName "TestVM-Ubuntu" -Confirm:$false
Remove-VMCheckpoint -VMName "TestVM-Ubuntu" -Name "Pre-Update"

# Export VM for backup
Export-VM -Name "TestVM-Ubuntu" -Path "D:\VMBackups"

# Import VM
Import-VM -Path "D:\VMBackups\TestVM-Ubuntu\Virtual Machines\*.vmcx" -Copy -GenerateNewId

# Live resize disk
Resize-VHD -Path "D:\VMs\TestVM-Ubuntu\disk.vhdx" -SizeBytes 80GB

Port Forwarding for NAT VMs

# Forward host port to VM (for services inside NAT VMs)
Add-NetNatStaticMapping -NatName "NATNetwork" `
    -Protocol TCP `
    -ExternalIPAddress "0.0.0.0" `
    -ExternalPort 8080 `
    -InternalIPAddress "172.16.0.10" `
    -InternalPort 80

# Forward SSH
Add-NetNatStaticMapping -NatName "NATNetwork" `
    -Protocol TCP `
    -ExternalIPAddress "0.0.0.0" `
    -ExternalPort 2222 `
    -InternalIPAddress "172.16.0.10" `
    -InternalPort 22

# List NAT mappings
Get-NetNatStaticMapping

Best Practices

  • Use Generation 2 VMs for better performance and UEFI support
  • Enable dynamic memory to efficiently share RAM between nested VMs
  • Use fixed-size VHDs for production VMs — better I/O performance than dynamic
  • Use NAT networking for internet access — external switches can conflict with VPS networking
  • Take checkpoints before major changes for easy rollback
  • Monitor resource usage: Nested VMs share the same physical resources as the host

Was this article helpful?