Logo

Hyper-V on Windows Server: native virtualization

 Hyper-V on Windows Server: native virtualization

Enable Hyper-V on your Windows Server VPS to create nested VMs. Ideal for labs, test environments, VDI, or hosting multiple systems on a single VeryCloud Ryzen Dedicated.

Introduction

Hyper-V is the type 1 hypervisor built into Windows Server. It lets you create virtual machines directly on your server without VMware or Proxmox.

Use cases:

  • Multi-OS test lab (Linux, Windows, BSD)
  • Isolation of multiple apps on a single Dedicated
  • VDI / remote Windows workstations
  • CI/CD with isolated environments

⚠️ On a VPS, Hyper-V requires nested virtualization enabled by your host. On VeryCloud Ryzen Dedicateds (with AMD-V), it's automatic. On VPS, contact support.

Prerequisites

  • Windows Server 2019 / 2022 / 2025 (Standard or Datacenter)
  • CPU with virtualization extensions (AMD-V / Intel VT-x)
  • At least 8 GB RAM (16-32 GB for multiple VMs)
  • Fast disk (NVMe recommended)
  • For a VPS: nested virtualization enabled by host

Step 1: Verify compatibility

Get-ComputerInfo -Property "HyperV*"

You must see:

HyperVRequirementDataExecutionPreventionAvailable : True
HyperVRequirementSecondLevelAddressTranslation    : True
HyperVRequirementVirtualizationFirmwareEnabled    : True
HyperVRequirementVMMonitorModeExtensions          : True

If all False, your host hypervisor doesn't allow nested virt.

Step 2: Install Hyper-V role

Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart

Server reboots. On restart, Hyper-V is active.

Verify

Get-Service vmms
Get-WindowsFeature Hyper-V

Step 3: Open Hyper-V Manager

virtmgmt.msc

Or via Server Manager → Tools → Hyper-V Manager.

Step 4: Configure a Virtual Switch

For your VMs to have network access, create a virtual switch.

External switch (VMs have Internet via your public IP)

# List physical adapters
Get-NetAdapter

# Create switch
New-VMSwitch -Name "vSwitch-External" -NetAdapterName "Ethernet" -AllowManagementOS $true

AllowManagementOS $true keeps host network access.

Internal switch (VMs to each other + host, no internet)

New-VMSwitch -Name "vSwitch-Internal" -SwitchType Internal

Private switch (VMs to each other only)

New-VMSwitch -Name "vSwitch-Private" -SwitchType Private

List switches

Get-VMSwitch

Step 5: Create a VM (PowerShell)

$VMName = "vm-debian-01"
$VMPath = "D:\VMs"
$ISOPath = "D:\ISOs\debian-12-amd64-netinst.iso"
$VHDPath = "$VMPath\$VMName\$VMName.vhdx"

# Create Gen 2 VM (UEFI)
New-VM -Name $VMName `
    -Generation 2 `
    -MemoryStartupBytes 4GB `
    -Path "$VMPath\$VMName" `
    -NewVHDPath $VHDPath `
    -NewVHDSizeBytes 40GB `
    -SwitchName "vSwitch-External"

# Allocate 2 vCPUs
Set-VMProcessor -VMName $VMName -Count 2

# Enable Dynamic Memory
Set-VMMemory -VMName $VMName `
    -DynamicMemoryEnabled $true `
    -MinimumBytes 2GB `
    -MaximumBytes 8GB

# Disable Secure Boot for Linux (otherwise boot error)
Set-VMFirmware -VMName $VMName -EnableSecureBoot Off

# Attach install ISO
Add-VMDvdDrive -VMName $VMName -Path $ISOPath

# Start the VM
Start-VM -Name $VMName

Step 6: Connect to the VM

vmconnect.exe localhost $VMName

Or via Hyper-V Manager → right-click VM → Connect.

You see the boot screen and can install OS like a normal PC.

Step 7: Manage VMs in PowerShell

# List
Get-VM

# Start / Stop
Start-VM -Name "vm-debian-01"
Stop-VM -Name "vm-debian-01" -Force

# Pause / Resume
Suspend-VM -Name "vm-debian-01"
Resume-VM -Name "vm-debian-01"

# Reboot
Restart-VM -Name "vm-debian-01" -Force

# Detailed state
Get-VM -Name "vm-debian-01" | Format-List *

# Delete (keeps VHD)
Remove-VM -Name "vm-debian-01" -Force

Step 8: Snapshots (Checkpoints)

Before a major update, create a snapshot:

# Create
Checkpoint-VM -Name "vm-debian-01" -SnapshotName "Pre-update-$(Get-Date -Format yyyy-MM-dd)"

# List
Get-VMSnapshot -VMName "vm-debian-01"

# Restore
Restore-VMSnapshot -Name "Pre-update-2026-05-16" -VMName "vm-debian-01" -Confirm:$false

# Delete a snapshot
Remove-VMSnapshot -VMName "vm-debian-01" -Name "Pre-update-2026-05-16"

⚠️ Snapshots are not backups. They're chained to the parent disk. For real backup, see step 12.

Step 9: Import/Export VMs

Export

Export-VM -Name "vm-debian-01" -Path "D:\Exports"

Export contains everything: config, VHD, snapshots. You can move the folder.

Import

Import-VM -Path "D:\Exports\vm-debian-01\Virtual Machines\xxx.vmcx" -Copy -GenerateNewId

-GenerateNewId lets you import alongside the original.

Step 10: VM templates

To deploy 10 identical VMs, create a template:

  1. Create a "golden" VM (Debian + base configs)
  2. Run sysprep (Windows) or cloud-init clean (Linux)
  3. Stop the VM
  4. Copy its VHDX:
Copy-Item "D:\VMs\template\template.vhdx" "D:\VMs\vm-new\vm-new.vhdx"
  1. Create a new VM pointing to this VHDX:
New-VM -Name "vm-new" -Generation 2 -MemoryStartupBytes 4GB -VHDPath "D:\VMs\vm-new\vm-new.vhdx" -SwitchName "vSwitch-External"

Step 11: Advanced networking

Per-VM bandwidth limit

Set-VMNetworkAdapter -VMName "vm-debian-01" -MaximumBandwidth 100MB

VLAN tagging

Set-VMNetworkAdapterVlan -VMName "vm-debian-01" -Access -VlanId 100

Static MAC address

Set-VMNetworkAdapter -VMName "vm-debian-01" -StaticMacAddress "00-15-5D-00-AA-01"

Step 12: Back up VMs

Simple solution: Hyper-V Replica

Async replication to another Hyper-V server:

# On target server
Set-VMReplicationServer -ReplicationEnabled $true -AllowedAuthenticationType Kerberos -ReplicationAllowedFromAnyServer $true -DefaultStorageLocation "D:\Replicas"

# On source server
Enable-VMReplication -VMName "vm-debian-01" -ReplicaServerName "DR-SERVER" -ReplicaServerPort 80 -AuthenticationType Kerberos
Start-VMInitialReplication -VMName "vm-debian-01"

Solution: Windows Server Backup

Install-WindowsFeature Windows-Server-Backup

# Backup config + VHD to external disk
wbadmin start backup -backupTarget:E: -hyperv:"vm-debian-01" -quiet

Advanced solution: Veeam Backup Free Edition

For centralized multi-VM management, free up to 10 VMs.

Step 13: Performance and tuning

Disable Time Synchronization for VMs with their own NTP

Disable-VMIntegrationService -VMName "vm-debian-01" -Name "Time Synchronization"

Enable SR-IOV (ultra-fast networking, if NIC supports)

Set-VMNetworkAdapter -VMName "vm-debian-01" -IovWeight 100

Storage QoS

Set-VMHardDiskDrive -VMName "vm-debian-01" -ControllerType SCSI -ControllerNumber 0 -ControllerLocation 0 -MaximumIOPS 1000

Troubleshooting

"Failed to start, virtualization not enabled"

On a VPS, ask host to enable nested virt. On a VeryCloud Ryzen Dedicated, AMD-V is on by default.

# Enable nested virt (from host, not VM)
Set-VMProcessor -VMName "vm-name" -ExposeVirtualizationExtensions $true

VM won't start (Gen 2)

For non-UEFI Linux ISOs, create a Gen 1 VM:

New-VM ... -Generation 1

Or disable Secure Boot (already done in step 5).

"The requested resource is in use"

Another operation in progress. Wait then:

Get-VM | Where-Object State -eq 'Stopping'

Network error in VM

Check vSwitch exists and bound to an up adapter:

Get-VMSwitch | Format-List Name, NetAdapterInterfaceDescription
Get-NetAdapter

Useful commands

# Overview
Get-VM | Format-Table Name, State, CPUUsage, MemoryAssigned, Uptime

# VMs with issues
Get-VM | Where-Object Status -ne 'Operating normally'

# Available resources
Get-VMHost | Select MemoryCapacity, LogicalProcessorCount

# List all VHDX
Get-VHD -Path "D:\VMs\*\*.vhdx" | Format-Table Path, Size, FileSize

# Compact a VHDX (VM off)
Optimize-VHD -Path "D:\VMs\vm-debian-01\vm-debian-01.vhdx" -Mode Full

# Resize a VHDX
Resize-VHD -Path "..." -SizeBytes 100GB

# Per-VM statistics
Measure-VM -Name "vm-debian-01"

# Disable Hyper-V (if needed)
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All

Conclusion

With Hyper-V you turn a Dedicated into a complete hypervisor:

  • Multiple OS on a single piece of hardware
  • App isolation (DB / web / app on separate VMs)
  • Snapshots before risky changes
  • Replication possible to a DR site

Going further:

  • Migrate to Windows Admin Center for a modern web UI
  • Use System Center Virtual Machine Manager (SCVMM) to orchestrate multiple hosts
  • For Linux only, Proxmox VE is often more convenient
  • WSL2 on Windows already uses Hyper-V in the background

Resources

Join our Discord community server

For any questions, suggestions, or just to chat with the community, join us on Discord!

900+Members