scloud by Florian Salzmann
ende

Create Your Own Hyper-V Intune Lab on Azure: A Step-by-Step Guide

  • Florian Salzmann
  • Posted on 01 Dec, 2025
  • Updated on 17 May, 2026
  • 03 Mins read
  • Microsoft Intune

I often use an Azure-based Hyper-V VM to test Intune deployments, preview features, and real-world scenarios across different tenants. With nested virtualization, I get a fully isolated Intune lab environment that I can start and stop on demand, without touching production systems.

In this guide, I’ll show you how to build your own Hyper-V Intune Lab on Azure step by step.

You’ll end up with:

  • One Azure VM with nested virtualization
  • A fully functional Hyper-V host inside Azure
  • An internal DHCP + NAT network
  • A Windows 11 test VM ready for Intune and Autopilot testing

Why a Hyper-V Intune Lab on Azure?

Running Hyper-V inside an Azure VM gives you a surprisingly powerful and flexible lab environment:

  • Cost-effective: You only pay while the VM is running.
  • Isolated testing: No risk for your productive Intune tenant.
  • Multi-tenant ready: Perfect for consultants and MVPs.
  • Real-world simulation: Full Windows provisioning, Autopilot, and policy testing.
  • Reset in minutes: Destroy and redeploy at any time.

Expected Azure Costs

Azure costs depend heavily on region and runtime, but as a rough orientation:

  • Recommended minimum size: Standard D4s v5 or D8s v5
  • Price range: ~CHF 0.20 – 0.50 per hour (depending on region)
  • OS disk: ~CHF 5–15 per month
  • Public IP: minimal cost

Important: Always deallocate the VM when not in use to avoid unnecessary charges.

Choosing the Right Azure VM

Nested Virtualization Requirements

Not every Azure VM supports nested virtualization. You must select the correct VM during deployment. This cannot be changed afterward.

Supportet SKU Family (at time of writing)

At the time of writeing those SKU failies are supported:

  • D_v3
  • Ds_v3
  • Dv4
  • Dsv4
  • Ddv4
  • Ddsv4
  • E_v3
  • Es_v3
  • Ev4
  • Esv4
  • Edv4
  • Edsv4
  • F2s_v2 - F72s_v2
  • FX4 - FX48
  • M
  • Mv2

Overview of the Azure Compute Unit - Azure Virtual Machines | Microsoft Learn

Important Limitations

  • B-series VMs are NOT supported
  • Standard security type must be used
  • You cannot enable nested virtualization later without redeploying the VM

Create the Azure VM

  1. Log in to the Azure Portal
  2. Click Create a resource
  3. Search for Virtual Machine
  4. Select your Subscription and Resource Group
  5. Configure the VM:
    • Image: Windows Server 2022 or Windows 11 Pro
    • Size: D4s v5 or larger
    • Security Type: Standard (NOT Trusted Launch)
    • Public IP: Required for initial RDP access
  6. Configure disks and networking as needed
  7. Review and create the VM

Once deployment is complete, connect via RDP to your new Azure VM.

Enable Hyper-V and DHCP (Clean Setup)

Open PowerShell as Administrator and run the following provisioning script.

This script:

  • Installs Hyper-V
  • Installs DHCP
  • Creates an internal virtual switch
  • Configures NAT
  • Creates a DHCP scope

  • Run the first part of the script, this will trigger an instand reboot after typing Y. The reboot is needed, before you can continue with the next steps.
# Install required Windows features
Install-WindowsFeature -Name DHCP, Hyper-V –IncludeManagementTools

# Enable Hyper-V feature using dism
dism /Online /Enable-Feature /FeatureName:Microsoft-Hyper-V /All

# Here you need to restart your VM

  • Open PowerShell again (as admin)
# Define the name for the virtual switch
$switchName = "vSwitchIntDHCP"

# Create a new internal virtual switch
New-VMSwitch -Name $switchName -SwitchType Internal

# Create a new Network Address Translation (NAT) configuration for the virtual switch
New-NetNat –Name $switchName –InternalIPInterfaceAddressPrefix "10.1.97.0/24"

# Get the interface index of the virtual switch
$ifIndex = (Get-NetAdapter | ? {$_.name -like "*$switchName)"}).ifIndex

# Assign an IP address to the virtual switch
New-NetIPAddress -IPAddress 10.1.97.1 -InterfaceIndex $ifIndex -PrefixLength 24

# Add a DHCP scope for the virtual switch
Add-DhcpServerV4Scope -Name "DHCP-$switchName" -StartRange 10.1.97.50 -EndRange 10.1.97.100 -SubnetMask 255.255.255.0

# Set DHCP server options
Set-DhcpServerV4OptionValue -Router 10.1.97.1 -DnsServer 168.63.129.16

# Restart the DHCP server service
Restart-Service dhcpserver

  • Thats it, Hyper-V is now ready, but let’s set some basic settings.

Creating a Windows 11 VM

Create Your First Windows 11 VM

Now we can create our first nested test VM.

Requirements

  • Generation 2 VM
  • Secure Boot enabled
  • TPM enabled
  • Minimum:
    • 4 vCPU
    • 8–12 GB RAM
    • 64 GB disk

Steps

  1. Download a Windows 11 ISO from Microsoft
    https://www.microsoft.com/software-download/windows11
  2. Open Hyper-V Manager
  3. Click New > Virtual Machine
  4. Select:
    • Generation: Gen 2
    • Memory: 8192 MB or more
    • Network: vSwitchIntDHCP
  5. Attach the Windows 11 ISO
  6. Enable TPM in VM settings
  7. Start the VM and install Windows normally

After installation, the VM will automatically receive:

  • An IP address via DHCP
  • Internet access via NAT through the Azure host

Autopilot & Intune Readiness

At this point, your Windows 11 VM behaves like a physical device:

  • It has full internet access
  • It supports TPM and Secure Boot
  • It can be onboarded into:
    • Microsoft Entra ID
    • Microsoft Intune
    • Windows Autopilot

You can now:

  • Capture the hardware hash
  • Upload it to Intune
  • Assign an Autopilot profile
  • Reset the VM and test your full enrollment flow

Conclusion

With this setup, you now have a fully functional Hyper-V Intune lab running on Azure. It allows you to:

  • Test policies safely
  • Validate Autopilot profiles (Self deploy wont work)
  • Simulate customer scenarios
  • Demo real-world deployments
  • Experiment with preview features

All without risking your production environment.
For me, this has become one of the most valuable tools for Intune engineering and validation.
Happy labbing.