fwupdmgr KEK 2011→2023 update fails with "efivarsfs: Invalid argument" on Trusted Launch Linux VM

Dovid Gross 20 Reputation points
2026-06-16T20:57:33.1933333+00:00

I'm following KB 5103014 ("Secure Boot certificate updates for Linux on Azure virtual machines") to replace the expiring Secure Boot 2011 certificates with 2023 on a Trusted Launch Linux VM. The fwupd update consistently fails when writing the KEK to the UEFI variable store. The VM still boots normally on the existing 2011 certificates, so nothing is currently degraded — I need the supported procedure to complete the update.

Environment

  • Azure Trusted Launch VM (Secure Boot + vTPM), Gen2, East US
  • Ubuntu 22.04.3 LTS, kernel 6.8.0-1031-azure
  • VM created 2023-10-19 (pre-April 2024, in scope per KB 5103014)
  • fwupd 2.1.4

Confirmed 2023 certs are absent

  • mokutil --db | grep "UEFI CA 2023" → no output
  • mokutil --kek | grep "KEK 2K CA 2023" → no output

Checks already done (rules out the common causes)

  • efivarfs mounted rw: efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
  • ESP mounted: /boot/efi on /dev/sdb15 (vfat, rw)
  • KEK variable is not immutable — lsattr shows no i flag

The failure sudo fwupdmgr refresh succeeds. sudo fwupdmgr update correctly offers "Upgrade KEK CA from 2011 to 2023 … signed by Microsoft Corporation Third Party Marketplace PCA", I confirm, and the write fails:

WARNING: UEFI ESP partition not detected or configured
...
failed to write-firmware: failed to write (null): failed to write data to efivarsfs: Error writing to file descriptor: Invalid argument

This matches a known fwupd issue reported across several platforms (e.g. fwupd GitHub issues #9483, #9191), with one report attributing it to an EFI variable-store space limitation.

Questions

  1. What's the supported way to complete the KEK/db 2023 update on a Trusted Launch Linux VM when fwupd fails this way?
  2. If the cause is EFI variable-store space, what's the safe, supported way to free space on a Trusted Launch VM without risking boot? (I'd rather not manually delete UEFI variables unless confirmed safe for this config.)
  3. Will the efitools / efi-updatevar manual method in KB 5103014 succeed where fwupd fails, or hit the same limit?
  4. Any vTPM / measured-boot impact from the recommended procedure?

I have a pre-change disk snapshot in place. Happy to provide fwupdmgr get-devices or dmesg'm following KB 5103014 ("Secure Boot certificate updates for Linux on Azure virtual machines") to replace the expiring Secure Boot 2011 certificates with 2023 on a Trusted Launch Linux VM. The fwupd update consistently fails when writing the KEK to the UEFI variable store. The VM still boots normally on the existing 2011 certificates, so nothing is currently degraded — I need the supported procedure to complete the update.

Environment

  • Azure Trusted Launch VM (Secure Boot + vTPM), Gen2, East US
  • Ubuntu 22.04.3 LTS, kernel 6.8.0-1031-azure
  • VM created 2023-10-19 (pre-April 2024, in scope per KB 5103014)
  • fwupd 2.1.4

Confirmed 2023 certs are absent

  • mokutil --db | grep "UEFI CA 2023" → no output
  • mokutil --kek | grep "KEK 2K CA 2023" → no output

Checks already done (rules out the common causes)

  • efivarfs mounted rw: efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
  • ESP mounted: /boot/efi on /dev/sdb15 (vfat, rw)
  • KEK variable is not immutable — lsattr shows no i flag

The failure sudo fwupdmgr refresh succeeds. sudo fwupdmgr update correctly offers "Upgrade KEK CA from 2011 to 2023 … signed by Microsoft Corporation Third Party Marketplace PCA", I confirm, and the write fails:

WARNING: UEFI ESP partition not detected or configured
...
failed to write-firmware: failed to write (null): failed to write data to efivarsfs: Error writing to file descriptor: Invalid argument

This matches a known fwupd issue reported across several platforms (e.g. fwupd GitHub issues #9483, #9191), with one report attributing it to an EFI variable-store space limitation.

Questions

  1. What's the supported way to complete the KEK/db 2023 update on a Trusted Launch Linux VM when fwupd fails this way?
  2. If the cause is EFI variable-store space, what's the safe, supported way to free space on a Trusted Launch VM without risking boot? (I'd rather not manually delete UEFI variables unless confirmed safe for this config.)
  3. Will the efitools / efi-updatevar manual method in KB 5103014 succeed where fwupd fails, or hit the same limit?
  4. Any vTPM / measured-boot impact from the recommended procedure?

I have a pre-change disk snapshot in place. Happy to provide fwupdmgr get-devices or dmesg

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.


Answer accepted by question author
Mike Slaunwhite 80 Reputation points
2026-06-25T15:54:20.91+00:00

I have the same issue. I opened a MS case and the response listed the root cause of:

"Azure’s hypervisor presents a virtualized EFI variables filesystem (efivarsfs) that is read-only for Secure Boot key updates from within the guest. Manual writes to KEK or UEFI CA variables inside a Linux VM are blocked by platform policy. Certificate rotation for Azure VMs is handled at the host/firmware level by Microsoft, not by guest-initiated firmware updates."

Steps to fix:

  • In the Azure Portal, go to the VM’s blade.Under Support + troubleshooting, select Redeploy. Click Redeploy to reprovision the VM onto a new host cluster that includes the rotated certificates.
  • Once redeployed, re-run 'sudo fwupdatemgr update'

This allowed me to update UEFI CA signatures db from 2011 to 2023. It also updated the UEFI forbidden signratures ("dbx") from 20230501 to 20250902.

This required a reboot.

After reboot mokutil --db | grep 'Subject:' does list both 2011 and 2023 versions of the UEFI CA. But mokutil --kek | grep 'Subject:' only lists the 2011 KEK CA.

re-ran fwupdmgr again and now it shows:

$ sudo fwupdmgr update

Devices with the latest available firmware version:

• UEFI CA

• UEFI dbx

Devices with no available firmware updates:

• KEK CA

• SBAT

I am now unsure if I should expect the KEK CA to get updated or not.

Was this answer helpful?

1 person found this answer helpful.

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2026-06-23T23:08:10.7266667+00:00

    Thanks for sharing details Dovid,

    We reviewed the details with our engineering team. Based on their analysis, the VM appears to be running an older firmware version. A firmware update containing the relevant fix was rolled out during the April/May timeframe; however, the current firmware on the affected node appears to predate that update.

    To ensure the VM picks up the latest firmware and associated fixes, we recommend performing a reboot of the VM at your earliest convenience during an appropriate maintenance window.

    After the reboot, the system should load the updated firmware components. For validation, the file version of vmfirmwarehcl.dll should be 26100.1577 or later.

    Please let us know once the reboot has been completed, and confirm whether the issue persists afterward. We will be happy to continue assisting if any further investigation is required.

    Was this answer helpful?

    1 person found this answer helpful.

  2. Dovid Gross 20 Reputation points
    2026-06-25T18:00:22.7+00:00

    Hemalatha's thread provides the definitive answer to the core issue. Jose's and Sunoj's posts were useful but not decisive. Mike's answer is an important follow-on to what Hemalatha provided.

    Was this answer helpful?

    0 comments No comments

  3. SUNOJ KUMAR YELURU 18,496 Reputation points MVP Volunteer Moderator
    2026-06-18T16:48:43.2+00:00

    Hello @Dovid Gross,

    Thank you for reaching out Q&A forum.

    1. Fix ESP detection in /etc/fwupd/fwupd.conf
    2. Check/free EFI variable store space (orphaned boot entries)
    3. Retry fwupdmgr update for KEK
    4. Separately enroll db 2023 via mokutil --import (independent of fwupd)
    5. Record PCR 7 before and after
    6. Reboot and verify: mokutil --db and mokutil --kek show 2023 certs
    7. Keep the disk snapshot until verified

    The failed to write data to efivarsfs: Error writing to file descriptor: Invalid argument error on a Trusted Launch VM is not a generic fwupd bug — it is almost certainly one of two things (or both):

    1. EFI variable store space exhaustion — Azure Trusted Launch VMs have a fixed virtual NVRAM size. The 2011 KEK/db entries plus MOK entries plus runtime variables can fill it, leaving insufficient space for the append-write of the 2023 certs.
    2. fwupd ESP detection failure — the WARNING: UEFI ESP partition not detected or configured line is a secondary issue. fwupd is writing via the efi-updatevar path but failing because it cannot locate the ESP capsule drop path. On Azure Gen2 VMs the ESP is often on sdb not sda, which confuses fwupd's heuristics.

    Supported Way to Complete the Update When fwupd Fails

    The supported fallback path per KB 5103014 is efi-updatevar + cert-to-efi-sig-list (efitools manual method). Before going there, first fix the fwupd ESP detection issue

    Confirm ESP location

    findmnt /boot/efi

    Set ESP path explicitly in fwupd config

    sudo mkdir -p /etc/fwupd

    sudo tee /etc/fwupd/fwupd.conf > /dev/null <<EOF

    [uefi_capsule]

    OverrideESPMountPoint=/boot/efi

    EOF

    Retry

    sudo fwupdmgr update

    If the ESP warning disappears but the write still fails with Invalid argument, you are hitting the variable store space issue.


    If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.

    Was this answer helpful?

    0 comments No comments

  4. Dovid Gross 20 Reputation points
    2026-06-16T22:36:10.1766667+00:00

    Hi Jose, thank you for the guidance - it got us further than fwupd did.

    Following your recommendation, I skipped fwupd entirely and used the efi-updatevar method from KB 5103014. Results:

    • sudo efi-updatevar -a -f DBUpdate3P2023.bin db - silent success (no output, no error)
    • sudo efi-updatevar -a -f KEKUpdate_Microsoft_PK1.bin KEK - Failed to update KEK: Invalid argument

    The db update appears to have applied. The KEK update fails with the same "Invalid argument" error as fwupd, suggesting this is not a tooling issue but a platform-level rejection of KEK writes on this VM.

    This VM matches the symptom description in the Known Issues article (KB 5085790) - "certain long-running Azure Trusted Launch Gen2 VMs where Secure Boot variables are maintained by the platform firmware." That article currently states "no required customer action; a resolution will be delivered through future updates."

    A few questions - I know you are not MS support, but perhaps you know, or an MS engineer might chime in:

    1. Is there any customer-actionable path to complete the KEK update on a Trusted Launch VM where the platform firmware is blocking KEK writes?
    2. Given the db update succeeded but KEK did not, is the VM in a consistent/safe state, or is a partial update problematic?
    3. Is the incoming platform fix expected before June 26?

    VM details if helpful: Ubuntu 22.04.3, kernel 6.8.0-1031-azure, fwupd 2.1.4, Trusted Launch Gen2, created October 2023.Hi

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.