About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
A new Generation 2 Linux virtual machine that stops at the firmware with a Secure Boot refusal is being blocked by Secure Boot. Microsoft's Hyper-V pages print no firmware message for this case, but they do state the rule behind it: Secure Boot is on by default in Generation 2 VMs, and "To Secure Boot generation 2 Linux virtual machines, you need to choose the UEFI CA Secure Boot template when you create the virtual machine." The fix is to change the VM's Secure Boot template, or to turn Secure Boot off when the guest cannot use it.
What the error means
Generation 2 VMs boot through virtual UEFI firmware. Microsoft says Secure Boot "verifies the boot loader is signed by a trusted authority in the UEFI database", and that it is enabled by default for Generation 2 VMs. A VM's Secure Boot template decides which authorities that database trusts. If the boot loader on the Linux disk was signed by an authority the chosen template does not include, the firmware refuses to run it and shows a Secure Boot refusal.
Microsoft's Linux troubleshooting page gives two ways out for a Generation 2 Linux install that stalls: "Disable Secure Boot or set it to use the correct template (for example, MicrosoftUEFICertificateAuthority for supported Linux distributions)." The distribution pages add that "some Linux virtual machines won't boot unless the secure boot option is disabled".
Two limits matter. A VM's generation cannot be changed after it is created. And the firmware message can have other causes, such as an unsigned boot loader, so the checks below come first.
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| Secure Boot template is not the UEFI CA template | New Generation 2 Linux VM stops at the firmware before the boot loader runs | Get-VMFirmware shows Secure Boot on with a template that does not suit the distribution; Microsoft names MicrosoftUEFICertificateAuthority for supported Linux distributions |
| The distribution or version does not boot with Secure Boot on this host | Fails even with the UEFI CA template | The distribution's Hyper-V support page lists Secure boot for your Windows Server version |
| An unsigned or incorrectly signed UEFI application or boot loader | Fails after a custom boot loader, shell or tool was added | Microsoft says such applications that are not digitally signed correctly need Secure Boot disabled |
| VM is Generation 1 | No UEFI message at all | Get-VM shows Generation 1, and Get-VMFirmware does not apply |
Prove the cause before changing anything
All of these only read. Run them in an elevated PowerShell on the Hyper-V host.
1. Confirm the VM and its generation.
Get-VM -Name web01 | Format-List *
A good result for this fault is a VM of Generation 2 in a state such as Running that never reaches the Linux boot loader. If the generation is 1, Secure Boot is not the cause; Get-VMFirmware is supported only on Generation 2 VMs.
2. Read the firmware settings.
Get-VMFirmware -VMName web01 | Format-List *
Microsoft's reference describes the cmdlet as one that "Gets the firmware configuration of a virtual machine". Look at whether Secure Boot is on and which template name is shown. A bad result for this fault is Secure Boot on with a template that does not suit your distribution, so the firmware does not trust its boot loader; the distribution page's Secure boot row (step 3) is the check, and MicrosoftUEFICertificateAuthority is Microsoft's documented fix. Save the output; the fix section reuses it.
3. Check the guest's support page. Open Microsoft's Hyper-V page for your distribution (Ubuntu, Debian, SUSE, or CentOS and Red Hat Enterprise Linux) and read the Generation 2 table row "Secure boot" for your Windows Server version. A tick means Microsoft lists the combination as supported.
4. Read the console. In Virtual Machine Connection, note whether the failure appears before the boot loader menu. If the boot loader menu or the kernel messages appear, Secure Boot is not what stops this VM.
Fix
Choose one of the two changes. Try the template first; it keeps Secure Boot on.
Set the UEFI CA template
Microsoft's Set-VMFirmware reference says "If secure boot is enabled, you must have a valid secure boot template for the guest operating system to start." and gives the -SecureBootTemplate parameter. In the COM-port example on its generation 1 or 2 page, Microsoft says "Make sure the virtual machine is in an Off state" before using Set-VMFirmware to disable Secure Boot; for the template change no page says so, so powering off first is this guide's own precaution.
First save the current firmware settings:
Get-VMFirmware -VMName web01 | Format-List * > vmfirmware-before-web01.txt
Disruptive step: the next commands power off web01 and start it again, which ends any session on it. Run them only if step 4 showed that web01 is stuck at the firmware and has not booted Linux, because -TurnOff does not shut the guest down cleanly.
Power off the VM, set the template, and start it:
Stop-VM -Name web01 -TurnOff
Set-VMFirmware -VMName web01 -SecureBootTemplate MicrosoftUEFICertificateAuthority
Start-VM -Name web01
To undo it: set the template name that vmfirmware-before-web01.txt shows, then read the setting back. Use the name exactly as the saved file prints it. The block ends with the VM off; start it again with Start-VM -Name web01 if it was running.
Risk: the next commands power web01 off without shutting the guest down, so anything the guest has not written to disk is lost.
Stop-VM -Name web01 -TurnOff
Set-VMFirmware -VMName web01 -SecureBootTemplate <template name from the saved file>
Get-VMFirmware -VMName web01 | Format-List *
Turn Secure Boot off
Microsoft's Ubuntu, SUSE, Debian and Red Hat pages give this for guests that will not boot with Secure Boot on (the Debian and SUSE pages word it for Windows Server 2012 R2): disable it in the Firmware section of the VM's settings in Hyper-V Manager, or with Set-VMFirmware -VMName "VMname" -EnableSecureBoot Off.
First save the current firmware settings, unless the file above already holds them. Use a new name so the earlier file is not overwritten:
Get-VMFirmware -VMName web01 | Format-List * > vmfirmware-before-secureboot-web01.txt
Risk: the next commands turn off Secure Boot for web01, so the virtual firmware stops checking that the boot loader is signed by a trusted authority. They also power the VM off.
Power off the VM, turn Secure Boot off, and start it:
Stop-VM -Name web01 -TurnOff
Set-VMFirmware -VMName web01 -EnableSecureBoot Off
Start-VM -Name web01
To undo it: the saved file shows Secure Boot was on, so turn it on again and read the setting back. The block ends with the VM off; start it again with Start-VM -Name web01 if it was running.
Risk: the next commands power web01 off without shutting the guest down, so anything the guest has not written to disk is lost.
Stop-VM -Name web01 -TurnOff
Set-VMFirmware -VMName web01 -EnableSecureBoot On
Get-VMFirmware -VMName web01 | Format-List *
Example (illustrative): an engineer builds web01, a Generation 2 Linux VM, from an installation image. It stops at the firmware with a Secure Boot refusal. Get-VMFirmware -VMName web01 | Format-List * shows Secure Boot on with a template that is not MicrosoftUEFICertificateAuthority. The Ubuntu support page lists Secure boot as supported for the host's Windows Server version. The engineer saves the output, powers web01 off, sets the template to MicrosoftUEFICertificateAuthority, starts it, and the boot loader menu appears.
Confirm the fix
Get-VMFirmware -VMName web01 | Format-List *shows the template you set (or Secure Boot off, if you chose that).- Virtual Machine Connection shows the boot loader menu and then the Linux login or console.
- The VM stays running after a guest restart. A boot that works once and fails after the first kernel update points to the boot loader path, not the template.
What to watch afterwards
- Create future Generation 2 Linux VMs with the UEFI CA template, as Microsoft's page directs, so the setting is not found out at first boot.
- Keep the Secure Boot row of the distribution's Hyper-V support page in view when you choose a distribution release.
- If you copy the disk of an existing Generation 2 Ubuntu VM to build another, Microsoft's Ubuntu page gives separate steps to run in the existing VM before its disk is copied (they put a copy of the ubuntu directory under a directory named boot in the EFI directory and rename shimx64.efi to bootx64.efi). Read them on that page before copying a disk.
Read next
Related articles you may want next.
- Backup & RecoverySecure Boot certificate changes and your recovery media: what physical servers need nowUnderstand Secure Boot certificate expiry, revocations and recovery-media compatibility, including firmware and BitLocker dependencies.Read article
- Backup & RecoveryLinux will not boot after a disk replacement or restore: UEFI boot entries, the EFI system partition, shim and SBATWhy a restored Linux server may not boot on UEFI: firmware boot entries, the EFI system partition, shim fallback and SBAT revocations on older media.Read article
- TroubleshootingHyper-V virtual machine fails to start: General access denied error (0x80070005)Hyper-V VM won't start: 'General access denied error' 0x80070005 or 'failed to initialize'? Add the VM ID to the file permissions with icacls, safely.Read article
Risks and limits
- These commands have not been run or lab-tested.
- Microsoft's pages do not print the firmware message or list every template name; only MicrosoftUEFICertificateAuthority appears. Do not guess other template names.
- Turning Secure Boot off is a security trade-off decided by whoever owns the VM.
- Pages for individual distributions name different Windows Server releases. Read the row for your host.
- The Microsoft Linux troubleshooting page does not give a version range for the template advice.
Sources
- Should I create a generation 1 or 2 virtual machine in Hyper-V? — Microsoft Learn, last updated 2025-06-18, accessed 1 December 2026
- Troubleshoot Linux virtual machine issues on Hyper-V — Microsoft Learn, last updated 2026-02-12, accessed 1 December 2026
- Supported Ubuntu virtual machines on Hyper-V — Microsoft Learn, last updated 2025-02-21, accessed 1 December 2026
- Supported SUSE virtual machines on Hyper-V — Microsoft Learn, last updated 2025-06-20, accessed 1 December 2026
- Supported Debian virtual machines on Hyper-V — Microsoft Learn, last updated 2026-01-21, accessed 1 December 2026
- Supported CentOS and Red Hat Enterprise Linux virtual machines on Hyper-V — Microsoft Learn, last updated 2026-04-13, accessed 1 December 2026
- Set-VMFirmware — Microsoft Learn, no date shown, accessed 1 December 2026
- Get-VMFirmware — Microsoft Learn, no date shown, accessed 1 December 2026
- Stop-VM — Microsoft Learn, no date shown, accessed 1 December 2026
- Start-VM — Microsoft Learn, no date shown, accessed 1 December 2026
- Get-VM — Microsoft Learn, no date shown, accessed 1 December 2026
This article was originally published on .