Dual-boot Fedora Kinoite + Windows working, but the solution feels brittle

Hi,

I used to dual-boot Fedora + Windows, but have recently wanted to try out Kinoite. This created a few unexpected issues:

  1. I was unable to boot into Windows
  2. I was unable to boot into Windows from GRUB

Some details:

  • Number of drives: 2
    • Fedora was installed on 1 drive, Windows on the other one
  • Number of EFI partitions: 1

Issue #1: Re-adding Windows to the EFI partition

Requirement: Windows Installation Media (e.g. some flash drive)

While installing Fedora Kinoite, I wiped the EFI partition. To fix this:

  1. Boot into Windows Installation Media
  2. Press Shift + F10
  3. Run Bcdboot <drive letter>:\Windows

Note: please read Microsoft’s docs on this: BCDBoot Command-Line Options | Microsoft Learn


Issue #2: Re-adding Windows to the Grub menu

Based on what I read on this thread, and specifically this answer How to modify Grub under an Atomic spin? - #9 by pramodvu1502, I attempted to add a new entry to /boot/loader/entries/.

I have attempted several different examples (some based on this blscfg (GNU GRUB Manual 2.14)), but I was never able to get the entry to show up on GRUB.

So, in the end, the workaround I ended up going for was through the /boot/grub2/user.cfg file:

...

menuentry "Windows Boot Manager" --id=windows {
    insmod chain
    search --no-floppy --fs-uuid --set=esp_path_placeholder XXXX-XXXX
    chainloader ($esp_path_placeholder)/EFI/Microsoft/Boot/bootmgfw.efi
}

This feels brittle: a global variable is set for the sole purpose of being used in the next command + I’m afraid this might break in the future.

Ideally, I would like to add an entry for windows via the BLS entries (/boot/loader/entries/windows.conf), but I was never able to get it to show on my GRUB menu, nor was I able to reach any logs that would show me why this entry wasn’t shown in the first place (what was wrong with my configs).


tl;dr is it possible to add a Windows BLS entry which GRUB can load?

Thanks in advance!

On one of my systems I’m dual booting Windows 11 and Silverblue. At installation I have used a distinct /boot/efi for Fedora, separate to Windows’ EFI partition, and added an entry to /boot/grub2/user.cfg, similar to yours. I’ve also added the following instruction in the same file, so that the system boots by default into the latest Fedora deployment:

# Make Fedora the default boot entry (counting starts at 0)
set default=1

This setup is working for me without issues for a couple of years already. No Windows updates or Silverblue upgrades to newer versions (rebases) have broken anything.

Thank you for your reply.

It’s nice to understand this apparently doesn’t break as easily as I thought.

The set default=1 is something I’ll use!

It would be nice if we could set default to the entry that was last used, because of Windows Update, but this is already an improvement on what I’ve got! Thanks!

When booting with grub it should be possible to do exactly that.

  1. edit /etc/default/grub and add a line that reads GRUB-SAVEDEFAULT=true
  2. run the command sudo grub2-mkconfig -o /boot/grub2/grub.cfg
  3. reboot

Now the next time you select a different fedora kernel (or windows) the last entry booted will be the default unless you change it or there is a kernel update in fedora. (The kernel update will reset the default index to 0, which will normally be the new kernel installed)

Not on Kinoite as it uses a static grub.cfg file, if I’m not mistaken.

That variable is only global while running grub2 code. Once you chainload, there is no grub2 code running anymore and the global variable is no more.

I would say that the way you have set it up is correct for kinoite and similar atomic variants.