Triple boot Rocky Linux 8.9, Ubuntu 22.04.3 LTS and Windows 11 Pro

I have installed Windows 11 Pro, Ubuntu 22.04.3 LTS and Rocky Linux 8.9 in that order.
GRUB2 shows Rocky Linux 8.9 as my main OS, Ubuntu 22.04.3 LTS but not Windows (which it did when I installed Ubuntu).
Windows 11 Pro is in an EFI GPT vfat partition. Ubuntu is also on EFI and Rocky Linux 8.9 not sure (I used defaults), but I think it is also on EFI on the same drive as Ubuntu. I can boot into Ubuntu and Rocky from GRUB2. I can boot to Windows by pressing F12 on the BIOS screen changing the boot drive.
I want to add Windows 11 Pro to the GRUB2 menu and boot with it. I have tried editing /etc/grub.d/40_custom as some posts on the net suggested but when going to boot I get “invalid signature”.
Can someone with GRUB2 knowledge post the code how to configure Windows 11 Pro EFI vfat GPT on GRUB2. I would be very much appreciated.


Have you tried running os-prober?

Regards Tom.

Of course. It detects my Ubuntu EFI install, but not the Windows EFI install. I also tried manually mounting the Windows EFI filesystem first just in case with no change in os-prober.
It should be simple. I am just missing the commands to make the Windows boot in 40_custom.

First, do note that there are two ways to provide custom entries:

# grep -3 custom /boot/efi/EFI/*/grub.cfg
### BEGIN /etc/grub.d/30_uefi-firmware ###
### END /etc/grub.d/30_uefi-firmware ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
### END /etc/grub.d/41_custom ###

The first is indeed edit of /etc/grub.d/40_custom
The second is edit of /boot/efi/EFI/*/custom.cfg (in EFI-booting EL8) or /boot/grub2/custom.cfg (in any EL9 or legacy-booting EL8).

On one UEFI system, the 30_os-prober would insert section:

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows Boot Manager (on /dev/nvme0n1p2)' --class windows --class os $menuentry_id_option 'osprober-efi-44AE-C2CE' {
	insmod part_gpt
	insmod fat
	search --no-floppy --fs-uuid --set=root 44AE-C2CE
	chainloader /EFI/Microsoft/Boot/bootmgfw.efi
# Other OS found, undo autohiding of menu unless menu_auto_hide=2
if [ "${orig_timeout_style}" -a "${menu_auto_hide}" != "2" ]; then
  set timeout_style=${orig_timeout_style}
  set timeout=${orig_timeout}
### END /etc/grub.d/30_os-prober ###

So it does search ESP by UUID and then chainloads bootmgfw.efi from there.
Both blkid and lsblk -f do show UUIDs.

I have that same entry for Windows 11 Pro:

menuentry 'Windows 11 (on /dev/sdb1)' --class windows --class os {
    insmod part_gpt
    insmod fat
    search --no-floppy --fs-uuid --set=root D210-9E80
    chainloader /EFI/Microsoft/Boot/bootmgfw.efi

but when I try booting with it, I get:

../../..etc.../i386/pc/chainloader.c: invalid signature

Note that it seems my Rocky Linux 8.9 was in legacy-booting /boot/grub2/grub.cfg (this was the default install that anaconda created). I have tried changing my BIOS also between Legacy or UEFI with no change. And albeit it is UEFI, I can boot into Ubuntu 22.04.3.

$ lsblk -f
NAME        FSTYPE  LABEL UUID                                   MOUNTPOINT
├─sda2      ntfs    datos EC869DDB869DA71C                       /media/gga/dato
├─sda3      vfat          E357-E60E                              
├─sda4      ext4          c818488b-5ecb-4753-90ba-6dcfb95c3ed3   
├─sda5      xfs           cbf828df-746b-4a3e-a838-940713f63a3a   /boot
└─sda6      LVM2_me       eysUcv-zwP0-y30Y-D9JS-dyb7-Ool4-SCa5B6 
  ├─rl-root xfs           2d1f5a4b-06fc-4954-9df5-218e2e587178   /
  ├─rl-swap swap          bf85be91-065c-4260-919f-829cb0fe09af   [SWAP]
  └─rl-home xfs           c6555365-ee3e-487b-9ac0-0aca8a23e712   /home
├─sdb1      vfat          D210-9E80                              
├─sdb3      ntfs          7A24116D24112D9F                       /media/gga/wind
└─sdb4      ntfs          AE20B18D20B15D51

In other words:

  • Windows is installed to boot with UEFI
  • Ubuntu is installed to boot with UEFI
  • Rocky is installed to legacy boot

and legacy GRUB can somehow boot Ubuntu, but not chainload MS EFI bootloader.

I would run the Rocky installer again and make sure that the installer boots with UEFI, not legacy. Then the resulting Rocky install (and GRUB) should also be UEFI-based.

1 Like