Windows BSOD boot failure

Bug #2030810 reported by Cliff Carson
60
This bug affects 10 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
High
Julian Andres Klode

Bug Description

Believe after the grub update that came out about 8/7/23 my Windows system will no longer boot. Getting the following error on a BSOD;

The digital signature for this file couldn't be verified (note; no file listed)

error code 0xc0000428

Doesn't appear to be a problem with Windows booting because I can change my boot device via bios to the windows device and Windows will boot fine.

Have the prior release of Ubuntu (22.10) on this system also. By booting that release and installing grub there I can boot either versions of Ubuntu and Windows without problems. Booting Ubuntu 23.04 and re-installing grub and then trying to boot Windows get the Windows BSOD again.

ProblemType: Bug
DistroRelease: Ubuntu 23.10
Package: grub-efi-amd64 2.12~rc1-4ubuntu1
ProcVersionSignature: Ubuntu 6.3.0-7.7-generic 6.3.5
Uname: Linux 6.3.0-7-generic x86_64
ApportVersion: 2.27.0-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Tue Aug 8 16:23:04 2023
InstallationDate: Installed on 2023-07-14 (25 days ago)
InstallationMedia: Ubuntu 23.10 "Mantic Minotaur" - Daily amd64 (20230712.1)
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: grub2-unsigned
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Cliff Carson (ccarson1) wrote :
Revision history for this message
Cliff Carson (ccarson1) wrote :

Error on release specified. Problem exist on pre-release 23.10 but when booting the prior replease 23.04 I can install grub and boot both 23.04, 23.10, and Windows.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2-unsigned (Ubuntu):
status: New → Confirmed
Revision history for this message
Heinrich Schuchardt (xypron) wrote :
Revision history for this message
Julian Andres Klode (juliank) wrote :

Can you try running `rmmod peimage` in the grub console before chainloading to WIndows? e.g.

Press c, enter `rmmod peimage`, enter `normal` to get back to menu and select Windows.

My recommendation would be to avoid booting Windows via grub altogether and boot it via the firmware boot menu ('press ... to select boot device' kind of option), this ensures that everything works correctly - booting via grub is a bit hacky as it messes up the TPM measurements.

Revision history for this message
Joachim Krais (joachim-krais) wrote :

With the 'rmmod peimage' in the grub console I could chainloading Windows again successfully.

I can understand your technical position but it isn't very comfortable to get first in the BIOS to start Windows for me. And for all not IT-stuff people it isn't too.
Also it has work fine for all the time and it doesn't start with the Ubuntu Version 23.10.

Revision history for this message
Cliff Carson (ccarson1) wrote :

For the casual Ubuntu/Windows user this problem will be difficult to resolve. Spent time trying to diagnose a Windows error code 0xc0000428 without success. Should have stopped and submitted a bug against grub when I found that booting Windows via bios works but I didn't and rebuilt my Windows system. Waste of time.

Revision history for this message
Joachim Krais (joachim-krais) wrote :

On Ubuntu, I have integrated following workaround (ugly, but it works actually).
Edit the file with sudo vim /boot/grub/grub.cfg and insert "rmmod peimage" on the menuentry for booting Windows.

menuentry 'Windows Boot Manager (on /dev/nvme0n1p1)' --class windows --class os $menuentry_id_option 'osprober-efi-8050-6F7A' {
        insmod part_gpt
        insmod fat
        rmmod peimage
        search --no-floppy --fs-uuid --set=root 8050-6F7A
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}

Revision history for this message
Cliff Carson (ccarson1) wrote :

Adding rmmod peimage to /boot/grub/grub.cfg work find for me, thanks

tags: added: foundations-todo
Changed in grub2-unsigned (Ubuntu):
importance: Undecided → Critical
assignee: nobody → Julian Andres Klode (juliank)
status: Confirmed → Triaged
importance: Critical → High
Revision history for this message
Julian Andres Klode (juliank) wrote :

I have added the rmmod as a temporary workaround while investigation continues. The bug will be closed when that lands and I will either reopen this or create a new bug to track the proper fix.

Essentially this got delayed because I failed to install Windows 11 in qemu due to some online account requirement that was not possible to work around, and booting Windows setup via chainloader without peimage failed with a different error, I'll try with Windows 10 later.

Changed in grub2-unsigned (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Julian Andres Klode (juliank) wrote :

Note that the workaround only works on systems with secure boot enabled, as I did not want to cause error messages on systems not using peimage and did not find a way to figure out if peimage was actually loaded while hacking this up quickly.

Revision history for this message
theofficialgman (theofficialgman) wrote :

I am experiencing the same issue on the -signed variants as well.

Adding `rmmod peimage` as shown above works as well.

Revision history for this message
Julian Andres Klode (juliank) wrote :

Tracking the workaround here now, the underlying bug is tracked in [Bug 2032294] [NEW] Proper fix for chainloading Windows

no longer affects: grub2-signed (Ubuntu)
affects: grub2-unsigned (Ubuntu) → grub2 (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.12~rc1-4ubuntu2

---------------
grub2 (2.12~rc1-4ubuntu2) mantic; urgency=medium

  * ubuntu-zfs-enhance-support.patch: Adjustments for 2.12 library
    (LP: #2029260)
  * zfs: on_exit: Unmount ${MNTDIR}/boot before ${MNTDIR} (LP: #2031042)
  * Temporarily rmmod peimage for os-prober chainloader entries (LP: #2030810)

 -- Julian Andres Klode <email address hidden> Mon, 21 Aug 2023 14:26:07 +0200

Changed in grub2 (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Peter Júnoš (petoju) wrote :

@juliank
This is still happening even after fix. Systems without secure boot enabled still don't boot.

Could you please reopen this bug so that it is obvious?

Revision history for this message
Julian Andres Klode (juliank) wrote :

@petoju As explained, the remaining issue for non-secureboot systems is tracked in bug 2032294. It may have been better to not close this bug and instead just reference it a different way, but what's done is done. I don't want to confuse the bot that syncs launchpad issues into the internal tracker.

Revision history for this message
theofficialgman (theofficialgman) wrote (last edit ):

still having this issue on mantic. secure boot is not enabled.
```
sudo mokutil --sb-state
SecureBoot disabled
Platform is in Setup Mode
```
```
grub2/mantic,now 2.12~rc1-4ubuntu3 amd64 [installed]
grub-efi-amd64-bin/mantic,now 2.12~rc1-4ubuntu1 amd64 [installed]
grub-efi-amd64-signed/mantic,now 1.194+2.12~rc1-4ubuntu1 amd64 [installed]
```

Revision history for this message
theofficialgman (theofficialgman) wrote :

@juliank

I have secure boot disabled but the -signed package installed. Thus this separate bug https://bugs.launchpad.net/ubuntu/+source/grub2-unsigned/+bug/2032294 does not apply as that is for the -unsigned package.

this if statement needs to be removed and `rmmod peimage` needs to be run in ALL cases

```
        if [ "$shim_lock" = "y" ]; then
                rmmod peimage
        fi
```

Revision history for this message
Julian Andres Klode (juliank) wrote :

No this is distinctly a bug in the -unsigned package which is where the -signed packages are built from.

I have fixed this properly in the meantime in Debian but I haven't managed to rebase and submit for signing yet.

Several more bugs had piled up.

The 'if' is necessary as otherwise you get errors if you haven't loaded peimage.

Revision history for this message
theofficialgman (theofficialgman) wrote :

Well all I can say is that it is not working with the current -signed package installed with secure boot disabled as described above and when I remove the if statement and replace it with `rmmod peimage` it now works.

Hopefully you can get the true fix merged ASAP and these manual workarounds are no longer necessary.

Benjamin Drung (bdrung)
tags: removed: foundations-todo
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.