Linux VM on Hyper-V Will Not Boot With Secure Boot on the Microsoft Windows Template
Overview
A Linux generation 2 VM on Hyper-V that stops in firmware with Secure Boot on is usually on the Microsoft Windows Secure Boot template, which trusts only Windows boot loaders. Confirm it with Get-VMFirmware, save the settings, turn the VM off and set the Microsoft UEFI Certificate Authority template, keeping Secure Boot on.
Diagnose
Symptom
What responders observe.
Secure Boot is enabled by default on generation 2 VMs, and Microsoft's guidance is that you need to choose the UEFI CA template for a Linux VM when you create it. The incident usually follows one of these changes: a new RHEL, Ubuntu or SUSE VM built in Hyper-V Manager or with New-VM without changing the template; a build script or VM template that sets the template for Windows servers and is reused for Linux; someone running Set-VMFirmware -SecureBootTemplate MicrosoftWindows against the wrong VM.
What people see: the VM starts, Hyper-V reports it as running, but the console never shows the GRUB menu or a Linux login, and nothing answers on the network.
Detection
Metrics, logs and confirmation commands.
Root cause
Why the incident occurred.
Contain and prevent
Blast radius
What else this can affect.
Prevention
Controls and guardrails that stop it recurring.
-
Set the template in the build script, straight after New-VM and before the first start, for every Linux VM.
-
Add a weekly report of Get-VM | Get-VMFirmware and review any Linux VM on the Microsoft Windows template or with Secure Boot off.
-
Record each VM with Secure Boot off as an exception with an owner and a review date.
-
Keep Linux and Windows VM templates separate, so a Windows setting can't drift into a Linux build.
-
The same habit of checking platform prerequisites before blaming the guest helps with Linux on Windows clients too, as in WSL 2 error 0x80370102 when Virtual Machine Platform is not enabled.
Fix
Pre-flight checks
Check these before you change anything.
-
Local administrator or Hyper-V Administrators membership on the Hyper-V host.
-
The Hyper-V PowerShell module on the host.
-
A generation 2 Linux VM and a folder for incident records.
Commands
Get-VM -Name RHEL01
Get-VMFirmware -VMName RHEL01 | Format-List *
Get-VM | Get-VMFirmware | Format-List *
Get-VMFirmware -VMName RHEL01 | Format-List * | Out-File C:\IR\RHEL01-firmware-before.txt
Stop-VM -Name RHEL01 -TurnOff
Set-VMFirmware -VMName RHEL01 -SecureBootTemplate MicrosoftUEFICertificateAuthority -WhatIf
Set-VMFirmware -VMName RHEL01 -SecureBootTemplate MicrosoftUEFICertificateAuthority
Start-VM -Name RHEL01
mokutil --sb-state
Verify and recover
Verification
Evidence required before you close the incident.
-
Watch the VM console after Start-VM. — Boot loader then a login prompt. — Linux reaches a login prompt.
-
Run Get-VMFirmware -VMName RHEL01 | Format-List *. — Secure Boot state and template. — Secure Boot on, template MicrosoftUEFICertificateAuthority.
-
Run mokutil --sb-state in the guest. — Secure Boot state. — Secure Boot reported as enabled. Ask the service owner to test the application. — Owner confirmation. — The service responds.
Rollback
The safe way back.
-
Turn the VM off and run Set-VMFirmware -VMName RHEL01 -SecureBootTemplate MicrosoftWindows, or whichever template RHEL01-firmware-before.txt records, then start it.
-
If the VM is Linux and rollback returns it to the failed state, leave it off and escalate to the Linux owner.
Escalate when
Conditions that need another owner.
-
The VM still won't boot on the Microsoft UEFI Certificate Authority template with Secure Boot on.
-
It runs a custom or third-party kernel, or kernel modules that aren't signed.
-
The VM has had the downloadable Linux Integration Services installed.
-
Red Hat certifies the drivers built into RHEL for Hyper-V, and Microsoft notes that installing the download may limit your Red Hat support.
-
The guest is RHEL 8.5 on a host older than Windows Server 2019.
-
Microsoft lists Windows Server 2019 or newer as a requirement for RHEL 8.5.
-
Microsoft's support tables for RHEL on Hyper-V mark Secure Boot as available for the RHEL 8, 9 and 10 series, so a current RHEL release that still fails needs a closer look at the boot chain, not a weaker setting.
-
Linux owner or Red Hat support.
Fixed? Get the next one before it hits you: The KBY Brief
Practical fixes for the systems you run, by email about twice a week. Unsubscribe at any time.
About this page
Credited to
Dates
Published
Corrections
No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.
Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
Sources
Based on the vendor sources listed below. Check each step against your environment before acting.
First published 23 November 2026
Generation 2 virtual machine security settings for Hyper-V
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Should I create a generation 1 or 2 virtual machine in Hyper-V?
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Supported CentOS and Red Hat Enterprise Linux virtual machines on Hyper-V
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Secure Boot on Virtual Machines
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Set-VMFirmware (Hyper-V)
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Get-VMFirmware (Hyper-V)
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Stop-VM (Hyper-V)
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Start-VM (Hyper-V)
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
Get-VM (Hyper-V)
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.
mokutil - utility to manipulate machine owner keys
Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.