Skip to main content

Linux VM on Hyper-V Will Not Boot With Secure Boot on the Microsoft Windows Template

High severity Target recovery 30mLinux

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.

Markdown, one checkbox per step, for pasting into a ticket.

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.

  1. Local administrator or Hyper-V Administrators membership on the Hyper-V host.

  2. The Hyper-V PowerShell module on the host.

  3. 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.

  1. Watch the VM console after Start-VM. — Boot loader then a login prompt. — Linux reaches a login prompt.

  2. Run Get-VMFirmware -VMName RHEL01 | Format-List *. — Secure Boot state and template. — Secure Boot on, template MicrosoftUEFICertificateAuthority.

  3. 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.

  1. Turn the VM off and run Set-VMFirmware -VMName RHEL01 -SecureBootTemplate MicrosoftWindows, or whichever template RHEL01-firmware-before.txt records, then start it.

  2. 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.

The KBY Brief

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

Publisher: Microsoft Learnlearn.microsoft.com

Generation 2 virtual machine security settings for Hyper-V

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Microsoft Learnlearn.microsoft.com

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.

Publisher: Microsoft Learnlearn.microsoft.com

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.

Publisher: Microsoft Learn (archived Microsoft blog)learn.microsoft.com

Secure Boot on Virtual Machines

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Microsoft Learnlearn.microsoft.com

Set-VMFirmware (Hyper-V)

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Microsoft Learnlearn.microsoft.com

Get-VMFirmware (Hyper-V)

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Microsoft Learnlearn.microsoft.com

Stop-VM (Hyper-V)

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Microsoft Learnlearn.microsoft.com

Start-VM (Hyper-V)

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Microsoft Learnlearn.microsoft.com

Get-VM (Hyper-V)

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.

Publisher: Ubuntu Manpages (Canonical)manpages.ubuntu.com

mokutil - utility to manipulate machine owner keys

Cited for: Supports the documented platform behaviour, diagnosis or recovery controls used by this Runbook.