4

I recently installed Windows 11 on my home PC in addition to Arch Linux but my wife isn't ready to switch until after her exams, so we keep Windows 10 around for now, leading to a very convoluted booting situation:

  1. On boot, systemd boot manager will wait for 3 seconds with a default of Windows 10 if nothing is chosen manually. When choosing Arch Linux, everything is fine and it will boot that, however when choosing Windows:
  2. It will boot Windows 11 and only then show the Windows boot manager, which will show Windows 10 and 11 but not Arch Linux (else this could be used directly) and wait 30 seconds and will boot whatever is booted last. If this Windows 11 is chosen, it will start it, however if Windows 10 is chosen:
  3. It will restart again, showing systemd boot manager again. Now if one chooses Windows 10, it will finally start it.

My goal is to just have the following 3 entries in my systemd-boot menu, how can I achieve that?

  1. Arch Linux
  2. Windows 10 (default)
  3. Windows 11

And chosing either Windows option should boot that directly. I looked around in the /boot/efi/Microsoft/Boot folder but the only .efi files are bootmgfw.efi and bootmgr.efi.

$ bootctl list

Boot Loader Entries:
        title: Arch Linux
           id: arch.conf
       source: /boot/loader/entries/arch.conf
        linux: /vmlinuz-linux-ck-skylake
       initrd: /intel-ucode.img
               /initramfs-linux-ck-skylake.img
      options: root=/dev/nvme0n1p5 rw nvidia-drm.modeset=1 systemd.unified_cgroup_hierarchy=false

        title: MemTest86
           id: memtest86-efi.conf
       source: /boot/loader/entries/memtest86-efi.conf

        title: Windows 10 (default)
           id: windows.conf
       source: /boot/loader/entries/windows.conf

        title: Windows Boot Manager
           id: auto-windows
       source: /sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f

        title: Reboot Into Firmware Interface
           id: auto-reboot-to-firmware-setup
       source: /sys/firmware/efi/efivars/LoaderEntries-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f

/boot/loader/loader.conf

timeout 3
console-mode max
default windows.conf

/boot/loader/entries/windows.conf

title   Windows 10
efi /EFI/Microsoft/Boot/bootmgfw.efi 
Konrad Höffner
  • 996
  • 1
  • 16
  • 26
  • 1
    I have deleted the answer as you don't want to move from `systemd-boot` to `grub2`. In short the idea with the grub2 was to hide it until key was pressed. You would then have visible only the windows boot. Good luck with `systemd-boot`. – tukan Feb 25 '22 at 09:36
  • @tukan: Good idea! However I would prefer if the Windows boot manager would not reboot in the first place. – Konrad Höffner Feb 25 '22 at 09:45
  • 1
    Windows boot loader never cared about anything else than windows and was usually broken even then. Why the windows boot loader restarts nobody know, probably not even at Microsoft for now. If want to have any change to have a single boot the only option, in my eyes, is `grub2`. `system-boot` is simpler with way less options than `grub2`. Your workflow is not a std. one to say the least :). I will undelete the update answer so you can get the idea. If you say you don't want it I'll delete/hide it again. – tukan Feb 25 '22 at 09:50

1 Answers1

0

Edit: An idea - having hidden grub and activate it only when certain key is pressed

I suggest using grub2 instead of systemd-boot which should give you more options. This solution will not show the "linux" boot manager (grub2) until ESC or F4 are pressed or SHIFT hold down (you have to try out which will work for you).

Do the following configuration at /etc/default/grub:

GRUB_TIMEOUT=3 (seconds until default option is selected)

GRUB_TIMEOUT_STYLE=hidden

‘GRUB_TIMEOUT_STYLE’

If this option is unset or set to ‘menu’, then GRUB will display the menu and then wait for the timeout set by ‘GRUB_TIMEOUT’ to expire before booting the default entry. Pressing a key interrupts the timeout.

If this option is set to ‘countdown’ or ‘hidden’, then, before displaying the menu, GRUB will wait for the timeout set by ‘GRUB_TIMEOUT’ to expire. If ESC or F4 are pressed, or SHIFT is held down during that time, it will display the menu and wait for input. If a hotkey associated with a menu entry is pressed, it will boot the associated menu entry immediately. If the timeout expires before either of these happens, it will boot the default entry. In the ‘countdown’ case, it will show a one-line indication of the remaining time.

I found out that sometimes you need to edit /etc/grub.d/30_os_prober and change to option quick_boot="1" to quick_boot="0" for it to work properly.

In the end you must run update-grub to update your configuration.

mashuptwice
  • 1,283
  • 5
  • 22
tukan
  • 4,876
  • 6
  • 19
  • I already have dual boot loaders (systemd-boot and Windows boot manager) but the problem is that the Windows boot manager has a very strange behaviour and will restart the system when the not-default Windows installation is chosen, which leads me back to systemd-boot, creating a very convoluted boot experience. – Konrad Höffner Feb 25 '22 at 08:56
  • @KonradHöffner You are talking about different bootloader. I'm talking having `grub2` instead of having `systemd-boot`. I'll edit the answer with one idea that came into my mind. – tukan Feb 25 '22 at 09:13
  • Unfortunately your answer does not help with my problem, as my case is different then the one you describe and I won't move operating systems to another drive just to fix a boot loader issue. And I also don't want to move from systemd-boot to grub2. – Konrad Höffner Feb 25 '22 at 09:31