When orchestrating virtualised development labs, automated continuous integration (CI) environments, or enterprise PXE network deployment pipelines (such as Windows Deployment Services or Microsoft Configuration Manager), controlling virtual machine startup sequencing is essential. In Generation 2 virtual machines, Microsoft Hyper-V replaces legacy BIOS interfaces with Unified Extensible Firmware Interface (UEFI) firmware. Manually clicking through graphical settings menus to adjust boot device priorities across dozens of test VMs introduces administrative overhead and human error. In Windows 11, administrators can automate and enforce precise firmware boot device sequencing using native PowerShell cmdlets and Set-VMFirmware.
Understanding Hyper-V UEFI Firmware Boot Architecture
Generation 2 virtual machines feature synthetic UEFI firmware that exposes an array of bootable hardware device objects. Unlike legacy BIOS setups that queried broad hardware classes (such as “Floppy”, “CD-ROM”, “Hard Drive”), Hyper-V UEFI firmware links directly to specific virtual hardware device instances:
- Virtual Hard Disk (VHDX): Represents the primary operating system volume attached to a synthetic SCSI controller.
- Virtual DVD Drive: Synthetic SCSI optical drive containing an attached installation ISO image.
- Network Adapter (PXE Boot): Synthetic network adapter configured for IPv4 or IPv6 network booting via Preboot Execution Environment (PXE).
- Boot File Entries: Direct NVRAM pointers to EFI boot binaries (such as
\EFI\Microsoft\Boot\bootmgfw.efior\EFI\BOOT\BOOTX64.EFI).
Inspecting Current Firmware Configuration and Boot Devices
Open PowerShell with Administrator privileges. Retrieve the firmware properties of your target virtual machine using Get-VMFirmware:
# Specify the target VM name
$VMName = "PXE-Deploy-VM"
# Query the current firmware and boot order
Get-VMFirmware -VMName $VMName | Select-Object -ExpandProperty BootOrder
The command outputs the active list of boot devices in priority order. To inspect the full firmware state (including Secure Boot templates and preferred network boot protocols):
Get-VMFirmware -VMName $VMName | Format-List
Configuring Boot Order to Prioritise PXE Network Deployment
To configure an automated deployment VM to attempt a PXE network boot before falling back to local storage, retrieve the network adapter device object and place it at the head of the boot array:
# Retrieve VM hardware device objects
$VM = Get-VM -Name $VMName
$NetworkAdapter = Get-VMNetworkAdapter -VMName $VMName
$HardDisk = Get-VMHardDiskDrive -VMName $VMName
$DVDDrive = Get-VMDvdDrive -VMName $VMName
# Define the new boot order: Network Adapter -> Hard Disk -> DVD Drive
Set-VMFirmware -VMName $VMName -BootOrder $NetworkAdapter, $HardDisk, $DVDDrive
Verify that the new sequence is committed to UEFI NVRAM:
(Get-VMFirmware -VMName $VMName).BootOrder | Format-Table Device, BootType
Prioritising ISO Installation Media for OS Provisioning
When installing a guest operating system from an attached ISO file, ensure the synthetic DVD drive sits at the top of the boot order:
# Assign ISO path to DVD drive
Set-VMDvdDrive -VMName $VMName -Path "C:\ISO\Ubuntu-24.04-Server.iso"
# Reorder boot sequence: DVD -> Hard Disk -> Network
Set-VMFirmware -VMName $VMName -BootOrder $DVDDrive, $HardDisk, $NetworkAdapter
Configuring UEFI Network Boot IP Protocols (IPv4 vs IPv6)
By default, Hyper-V UEFI firmware may attempt both IPv4 and IPv6 PXE handshakes, which can introduce substantial timeout delays if your corporate deployment server operates exclusively on IPv4. Restrict network boot to IPv4:
# Enforce IPv4 network boot protocol
Set-VMFirmware -VMName $VMName -IPProtocolPreference IPv4
For IPv6-native data centres, switch the preference:
Set-VMFirmware -VMName $VMName -IPProtocolPreference IPv6
Automating Boot Order Re-sequencing Across Staging Fleets
To standardize boot configurations across multiple test VMs in a staging environment, automate configuration using a PowerShell pipeline:
Get-VM -Name "Staging-*" | ForEach-Object {
$Name = $_.Name
Write-Host "Setting PXE-first boot sequence on: $Name"
$NIC = Get-VMNetworkAdapter -VMName $Name
$Disk = Get-VMHardDiskDrive -VMName $Name
Set-VMFirmware -VMName $Name -BootOrder $NIC, $Disk -IPProtocolPreference IPv4
}
Validating the Boot Sequence at Virtual Machine Startup
Start the virtual machine:
Start-VM -Name $VMName
Open VMConnect to observe the initial firmware handoff. The UEFI firmware immediately initializes the synthetic network adapter, performs DHCP negotiation, and contacts your TFTP deployment server before touching local disks.
Automating Set-VMFirmware via PowerShell eliminates manual configuration friction, ensuring predictable, repeatable deployment workflows across Windows 11 Hyper-V environments.