[Tutorial] Add a systemd-boot loader Menu entry for a Windows installation using a separate ESP Partition

What do you do if most your drive inc windows does not have alias? Only my Linux FS has a alias to use.

Yes my windows boots off its own efi partition on its own drive.

Figured it out, had a microSD or some USB interferrence that was changing or wiping my alias’s somehow. Had to disconnect everything and reconnect, maybe bad connection or bad port who knows.

HOWEVER, while choosing windows11 option exists and selects, when I boot it, it SITS at a Windows Boot Manager screen with Windows 11 selected but no input works, only alt-ctrl-del (soft reboot) works.

thats usually a sign that your config has some typo or wrong path in it.
I also had it when a BIOS update re-enabled Fast Boot, after I disabled it, made sure the right alias is set, everything worked again.

if its the wrong alias then why would it goto the windows 11 boot menu?

Also fast boot is off.

I followed the tutorial and now windows is showing in the boot menu, but when I select it, nothing happens. Can someone help me? I have 2 ssd’s

tree             
.
├── df8afa18a1614987b4d6ba39ed86193d
│   └── 6.3.3-arch1-1
│       ├── initrd
│       ├── initrd-fallback
│       └── linux
├── EFI
│   ├── BOOT
│   │   └── BOOTX64.EFI
│   ├── Linux
│   └── systemd
│       └── systemd-bootx64.efi
├── loader
│   ├── entries
│   │   ├── df8afa18a1614987b4d6ba39ed86193d-6.3.3-arch1-1.conf
│   │   ├── df8afa18a1614987b4d6ba39ed86193d-6.3.3-arch1-1-fallback.conf
│   │   └── windows.conf
│   ├── entries.srel
│   ├── loader.conf
│   └── random-seed
├── shellx64.efi
└── windows.nsh
sudo blkid
/dev/nvme0n1p3: LABEL="swap" UUID="de9d8b8c-ff5d-4dd3-9825-09c2781a3f33" TYPE="swap" PARTUUID="285b0c85-baf3-8f40-9290-4efcb79b3527"
/dev/nvme0n1p1: UUID="E722-8D4B" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="914e6d81-08c7-cd40-a24c-ee824850e1d3"
/dev/nvme0n1p2: LABEL="endeavouros" UUID="93534126-e4a9-4ff7-8a50-62656e2bee57" BLOCK_SIZE="4096" TYPE="ext4" PARTLABEL="endeavouros" PARTUUID="27ba2631-feb3-134f-80f6-26b4e70dec02"
/dev/sda2: BLOCK_SIZE="512" UUID="78C8D485C8D442D4" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="d5977111-1f34-4d83-ba6b-d70f3d20cc02"
/dev/sda1: PARTLABEL="Microsoft reserved partition" PARTUUID="8e9c548b-cebb-4e6a-be6b-c9c7d2a51717"

EFI shell:

/efi/loaders/entries/windows.conf

title  Windows
efi     /shellx64.efi
options -nointerrupt -noconsolein -noconsoleout windows.nsh

/efi/windows.nsh

HD1b:EFI\Microsoft\Boot\Bootmgfw.ef

you are missing an i at the end, the file ending is .efi

are you sure that you have your Windows prepared, e.g. having fast shutdown off in windows, and when using the UEFI boot manager to select the Windows partition, does it boot straight through to the desktop? Or does it sit a the boot manager, too?

sorry, i copied it wrong. It’s correct in the file

I noticed that I don’t have that directory on my windows. The bootmgfw.efi file is located in the Windows/Boot/EFI folder. I changed the path to Windows\Boot\EFI\bootmgfw.efi, but it still doesn’t work. I also tried to upgrade to windows 11, but my flash drive with windows is not recognized either

Thanks @BS86 for the Tutorial, thought it couldn’t be done for a Windows installation using a separate ESP partition. On a side note, even works with Secure Boot enabled.

sbctl status
[sudo] password for sam: 
Installed:	✓ sbctl is installed
Owner GUID:	0593f679-6a22-4c4d-a1b3-5e2fb70d0c9a
Setup Mode:	✓ Disabled
Secure Boot:	✓ Enabled
Vendor Keys:	
1 Like

windows partition is fine, using it right now. I believe I turned off fast boot in bios and fast shutdown recently but will check again.

that’s very strange, sorry but I am of no further help in that. Maybe recheck that the Alias is definitely correct.

Thank you so much for such great and easy tutorial!
The only thing I’ve added myself is
`auto-entries 0’
to remove them.

Thanks for this tutorial, it worked well for me. I have a couple of general questions though.

Why can’t windows.nsh be in a directory inside the ESP like shellx64.efi, since when I tried that windows wouldn’t boot.

How does this method work? Maybe this is a bit of a stupid question but I’m just curious to what each step of the process actually does and how it boots windows.

Why use this over XBOOTLDR that systemd-boot natively supports? Where you can store all your kernel images in another partition so you can just use your windows ESP partition.

It would be great if you could answer these questions. Thanks for your help

I am not sure and currently don’t have the time to investigate, but I guess it is due to some restrictions on where which type of files can be.

Personally, I don’t like to mix ESP partitions. Windows used to wipe other OS’s informations from their ESP partition more then once, causing issues where one has to chroot into the install(s) and reinstall the boot loaders of the other OS’s. With separated ESP partitions, those Windows updates only changed the default boot order in UEFI back to the Windows ESP partition which can easily be changed again without the need to actually fix things.

Thank you for your help!

Hi @sammiev, how did you manage to make it work with secure boot? When I select the windows entry from systemd-boot menu I get “Security violation”

If using sbctl make sure when you enroll the keys you use the -m option.

sbctl enroll-keys -m

Should do a little reading on sbctl and start a new thread if needed.

1 Like

My bad, I forgot to sign the shellx64.efi image with my keys. Now it works, apart from Bitlocker asking the key every time I boot from the windows.nsh entry

When i restart and select the efi shell from the menu nothing happens. Is there a solution for that? I copied the file correctly and it appears in the menu but after selecting it i just have a blank screen and need to restart.

Or maybe an alternative solution for this particular step?

I just checked again with all packages from stable and edk2-shell works here without issues.

Unfortunately, I know of no other way to get the FS Alias.
Furthermore, later on you also need a working edk2-shell to load the windows.nsh file, so even if you can retrieve that on another way, it won’t work.

Because it doesn’t happen here and a quick google search also does not prove useful, I can only give some general hints, like making sure that secure boot is not the issue, that fast boot in BIOS and also fast shutdown/boot in Windows is disabled etc.
You can also try if Shell_Full.efi works better, it is in the same source like the regular Shell.efi.

Thank you for the response. I have secure/fast boot disabled. I will try the Shell_Full.efi.

Maybe it will work. Otherwise maybe i messed something up.

Wanted to have Windows system as a backup but by now its not even really neccesary to have it because most things work great with this distro. =)

same here. I only have my Windows partition in case some game has issue on Linux that can’t be fixed, but so far every issue I had with games also happened on Windows :crazy_face:

1 Like