Skip to content
VirtualLP Virtual Learning Platform

Practical 3: Native Virtualization using Hyper-V

20 min read Topic 12 of 31 1 hands-on lab

Aim

Turn on Microsoft Hyper-V. Create a virtual switch and a VM (Virtual Machine). Use Hyper-V Manager and PowerShell to start the VM, change its settings and create a checkpoint.

A snapshot or checkpoint depends on the VM disks. It is not an independent backup.

Theory

Hyper-V is Microsoft's virtualization system. It uses processor support such as Intel VT-x (Virtualization Technology for x86) or AMD-V (AMD Virtualization) to run guest operating systems.

The guest operating system is the Windows or Linux system inside a VM. A virtual switch connects VMs to a network. A checkpoint records a VM state that you can return to during practice.

Microsoft Hyper-V is a Type-1, microkernel hypervisor. When you switch the role on, Windows itself is moved into a special VM called the parent (root) partition, and Hyper-V runs underneath it.

the owner moves into a flat

Before Hyper-V, Windows is the owner living in the whole house. After you enable Hyper-V, a building manager (the hypervisor) takes control of the land, and the owner (Windows) moves into the main flat (parent partition) – still the boss of the other flats (child partitions), but now living on top of the manager. That is why Hyper-V is Type-1 even though you "install" it from Windows.

flowchart TB
    subgraph PP[Parent / root partition – Windows]
        VMMS[VMMS – Virtual Machine<br/>Management Service]
        VWP[VM worker processes]
        VSP[VSPs – Virtualization<br/>Service Providers + real drivers]
    end
    subgraph CP1[Child partition – Windows guest]
        VSC1[VSCs / Integration services]
    end
    subgraph CP2[Child partition – Linux guest]
        VSC2[VSCs / LIS drivers]
    end
    VSC1 & VSC2 -- VMBus --> VSP
    PP & CP1 & CP2 --> HV[Hyper-V hypervisor]
    HV --> HW[Hardware with VT-x/AMD-V, SLAT]
Term Meaning
Parent (root) partition The management OS (Operating System) (Windows) with the real drivers, VMMS (Virtual Machine Management Service) and Hyper-V Manager
Child partition A guest VM
VMBus A fast in-memory channel between the child and parent partitions
VSP / VSC (Virtualization Service Client) Virtualization Service Provider (in parent) / Client (in child) – fast "synthetic" devices
Integration Services Guest helpers for time sync, heartbeat, shutdown, data exchange, backup
Virtual switch External, Internal or Private network switches
VHDX (Virtual Hard Disk version 2) Hyper-V's virtual disk format (up to 64 TB, protects against corruption)
Checkpoint A point-in-time snapshot of a VM (Standard or Production)

Generation 1 vs Generation 2 VMs

Generation 1 Generation 2
Old BIOS (Basic Input/Output System), imitated (emulated) devices (IDE (Integrated Development Environment), legacy NIC (Network Interface Card)) UEFI (Unified Extensible Firmware Interface) firmware, synthetic devices only
Boots from IDE Boots from SCSI (Small Computer System Interface) or network (PXE (Preboot Execution Environment))
Supports 32-bit and older OSes 64-bit Windows 8/Server 2012+ and modern Linux
VHD (Virtual Hard Disk) or VHDX VHDX only; supports Secure Boot and vTPM

Virtual switch types

Type Who can talk
External VMs ↔ host ↔ the real network (bound to a physical network card)
Internal VMs ↔ host only
Private VMs ↔ VMs only (isolated)
Default Switch (Windows 10/11) NAT (Network Address Translation) to the host's network, created automatically

Requirements

  • A 64-bit CPU (Central Processing Unit) with SLAT (Second Level Address Translation) (EPT (Extended Page Tables)/RVI (Rapid Virtualization Indexing)), VT-x/AMD-V and DEP (Data Execution Prevention) enabled in BIOS.
  • Windows 10/11 Pro, Enterprise or Education, or Windows Server 2019/2022/2025.
  • At least 4 GB RAM (Random Access Memory) (8 GB+ recommended).
  • An OS ISO (for example Ubuntu Server or Windows Server evaluation).

Check support:

systeminfo | findstr /i "Hyper-V"
# Hyper-V Requirements: VM Monitor Mode Extensions: Yes
#                       Virtualization Enabled In Firmware: Yes
#                       Second Level Address Translation: Yes
#                       Data Execution Prevention Available: Yes

All four lines must say Yes. If "Virtualization Enabled In Firmware" says No, turn it on in the BIOS.

Procedure

Part A – Enable Hyper-V

On Windows Server (Server Manager):

  1. Server Manager → Manage → Add Roles and Features.
  2. Role-based or feature-based installation → select the server.
  3. Tick Hyper-V → Add Features (management tools) → Next.
  4. Virtual Switches: select the physical network card to create an external switch (optional).
  5. Migration and Default Stores: accept the defaults (C:\ProgramData\Microsoft\Windows\Hyper-V).
  6. Tick Restart the destination server automatically → Install. The server restarts (twice).

On Windows 10/11: Turn Windows features on or off → tick Hyper-V (Platform + Management Tools) → restart.

With PowerShell (run as Administrator):

# Windows Server
Install-WindowsFeature -Name Hyper-V -IncludeManagementTools -Restart

# Windows 10/11
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

# Verify after restart
Get-WindowsFeature -Name Hyper-V*        # Server
Get-Service vmms                          # Virtual Machine Management Service: Running

After the restart, Get-Service vmms must show Running – that is the service that manages VMs.

Part B – Create a virtual switch

  1. Open Hyper-V Manager (virtmgmt.msc) → select the host → Virtual Switch Manager…
  2. Choose External → Create Virtual Switch.
  3. Name ExternalSwitch, connection type External network → select the physical adapter, tick Allow management operating system to share this network adapter → OK (the network disconnects for a moment).
Get-NetAdapter
New-VMSwitch -Name "ExternalSwitch" -NetAdapterName "Ethernet" -AllowManagementOS $true
New-VMSwitch -Name "InternalSwitch" -SwitchType Internal
Get-VMSwitch

List the real network cards → create an External switch on "Ethernet" → create an Internal switch → list the switches.

Part C – Create a virtual machine (New Virtual Machine Wizard)

  1. Action → New → Virtual Machine… → Before You Begin → Next.
  2. Specify Name and Location: UbuntuVM01.
  3. Specify Generation: Generation 2.
  4. Assign Memory: 2048 MB, tick Use Dynamic Memory (Hyper-V gives more or less RAM as needed).
  5. Configure Networking: ExternalSwitch.
  6. Connect Virtual Hard Disk: Create a virtual hard disk, UbuntuVM01.vhdx, size 25 GB.
  7. Installation Options: Install an operating system from a bootable image file → browse to the Ubuntu ISO.
  8. Summary → Finish.
  9. For Linux on Generation 2: Settings → Security → Secure Boot template Microsoft UEFI Certificate Authority (or untick Secure Boot). Without this, Linux will not boot.
  10. Settings → Processor: 2 virtual processors.
  11. Connect… → Start and install the operating system in the VM window.

Part D – Create the same VM with PowerShell

New-VM -Name "UbuntuVM02" -Generation 2 -MemoryStartupBytes 2GB `
       -NewVHDPath "C:\Hyper-V\UbuntuVM02.vhdx" -NewVHDSizeBytes 25GB `
       -SwitchName "ExternalSwitch"
Set-VMProcessor -VMName "UbuntuVM02" -Count 2
Set-VMMemory -VMName "UbuntuVM02" -DynamicMemoryEnabled $true -MinimumBytes 1GB -MaximumBytes 4GB
Add-VMDvdDrive -VMName "UbuntuVM02" -Path "C:\ISO\ubuntu-24.04-live-server-amd64.iso"
Set-VMFirmware -VMName "UbuntuVM02" -SecureBootTemplate "MicrosoftUEFICertificateAuthority" `
               -FirstBootDevice (Get-VMDvdDrive -VMName "UbuntuVM02")
Start-VM -Name "UbuntuVM02"
Get-VM

Line by line: create a Gen 2 VM with 2 GB RAM, a new 25 GB disk and the external switch → give it 2 CPUs → dynamic memory 1–4 GB → add a DVD drive with the Ubuntu ISO → set Secure Boot for Linux and boot from the DVD first → start it → list the VMs. (The backtick ` at the end of a line means "the command continues on the next line".)

Part E – Manage the VM

  1. Checkpoint: right-click the VM → Checkpoint (or Checkpoint-VM -Name UbuntuVM01 -SnapshotName "BeforeUpdate").
  2. Revert / Apply a checkpoint to go back in time.
  3. Settings: add memory, processors, a second disk (SCSI Controller → Hard Drive → Add), or a network card.
  4. Try Shut Down (polite, through integration services), Turn Off (power cut), Save (like hibernate), Pause.
  5. Enhanced Session for clipboard and drive sharing (Windows guests).
  6. Export the VM to move it to another host; Import it there.
Get-VM | Select Name, State, CPUUsage, MemoryAssigned, Uptime
Stop-VM -Name UbuntuVM01                 # graceful shutdown
Stop-VM -Name UbuntuVM01 -TurnOff        # hard power-off
Get-VMSnapshot -VMName UbuntuVM01
Restore-VMSnapshot -VMName UbuntuVM01 -Name "BeforeUpdate" -Confirm:$false
Export-VM -Name UbuntuVM01 -Path D:\Exports
Remove-VM -Name UbuntuVM02 -Force

Virtual lab · Microsoft Hyper-V · 35 min

Native virtualization with Microsoft Hyper-V

On Windows Server 2022, add the Hyper-V role, create an external virtual switch, build a Generation 2 VM with the New Virtual Machine Wizard, fix the Secure Boot trap for Linux guests, install the OS, take a checkpoint and automate a second VM with PowerShell.

Open lab

Output / Observations

Example output for the settings in this lesson:

PS C:\> Get-VM

Name       State   CPUUsage(%) MemoryAssigned(M) Uptime           Status             Version
----       -----   ----------- ----------------- ------           ------             -------
UbuntuVM01 Running 3           2048              00:12:41.5400000 Operating normally 11.0
UbuntuVM02 Off     0           0                 00:00:00         Operating normally 11.0
  • Hyper-V Manager lists the VMs with their state, CPU usage, assigned memory and uptime.
  • The VM window shows the guest OS running; the Checkpoints pane shows BeforeUpdate.

Conclusion

Check that Hyper-V is enabled and the VM starts. Check the virtual switch connection and the Generation 2 settings. Create a checkpoint and find the VM through both Hyper-V Manager and PowerShell.

Viva questions

  1. What is native virtualization? Which CPU features does it require? Running unmodified guests directly on the CPU using Intel VT-x / AMD-V (plus SLAT for Hyper-V).
  2. Explain the Hyper-V architecture: parent partition, child partition and VMBus. Parent = management Windows with real drivers; child = guest VMs; VMBus = fast channel between them.
  3. What is SLAT and why does Hyper-V need it? Second Level Address Translation (EPT/RVI) – the CPU translates guest memory addresses in hardware, which makes VMs much faster.
  4. Differentiate Generation 1 and Generation 2 VMs. Gen 1: BIOS, emulated devices, older OSes; Gen 2: UEFI, synthetic devices, Secure Boot, VHDX only.
  5. Explain External, Internal and Private virtual switches. External reaches the real network; Internal reaches only the host; Private only VM to VM.
  6. What are Integration Services? Guest helpers for time sync, heartbeat, shutdown, data exchange and backup.
  7. Differentiate Shut Down, Turn Off and Save. Shut Down closes the OS cleanly; Turn Off cuts power; Save stores the running state to disk like hibernate.
  8. What is a checkpoint? Differentiate Standard and Production checkpoints. A save point; Standard saves memory state too, Production uses in-guest backup (VSS (Volume Shadow Copy Service) / file-system freeze) for a clean, app-consistent copy.
  9. What is the VHDX format? Hyper-V's virtual disk format – up to 64 TB, resilient to corruption.
  10. Write the PowerShell command to create a VM with 2 GB RAM and a 25 GB disk. New-VM -Name VM1 -Generation 2 -MemoryStartupBytes 2GB -NewVHDPath C:\VM1.vhdx -NewVHDSizeBytes 25GB

Practise this topic

Hands-on virtual lab

Apply what you just read in a realistic, guided simulation. Free with a verified account.

Create a free account to track your progress and unlock virtual labs.