12

I seem to have windows passing by on GRUB/Ubuntu. There's no Ubuntu folder under Windows. I can boot from firmware to Grub, then choose either OS. I removed Wubi/Ubuntu and reinstalled directly to the same partitions.

The windows Boot Manager did not create an entry for Ubuntu, so I need to create the entry. Wubi puts wubildr.mbr on my system... but this is the wrong thing for EFI installs. I need the shimx64.efi so the created Windows boot in EFI might work.

I will make a copy of my boot with bcdedit, and point the entry to Ubuntu.

If this is incorrect, please tell me what to do next?

oxr463
  • 255
WLC
  • 121

3 Answers3

20

If you want to add an UEFI entry for Ubuntu with bcdedit, you can use the following commands as administrator:

List all BCD entries for UEFI:

bcdedit /enum firmware

Copy UEFI entry of "Windows Boot Manager" to create a new entry for Ubuntu:

bcdedit /copy {bootmgr} /d "Ubuntu Secure Boot"

Set file path for the new Ubuntu entry. Replace {guid} with the returned GUID of the previous command.

bcdedit /set {guid} path \EFI\ubuntu\shimx64.efi

Set optionally Ubuntu as first entry in the boot sequence. Replace {guid} with the returned GUID of the copy command.

bcdedit /set {fwbootmgr} displayorder {guid} /addfirst

Alternatively, you can use a script which does the job for you:

@ECHO OFF
rem add Ubuntu EFI entry

bcdedit /enum firmware

for /f "tokens=2 delims={}" %%a in ('bcdedit /copy {bootmgr} /d "Ubuntu Secure Boot"') do set guid={%%a}
bcdedit /set %guid% path \EFI\ubuntu\shimx64.efi
bcdedit /set {fwbootmgr} displayorder %guid% /addfirst

bcdedit /enum firmware 
  • This might help. But The system start-up (Firmware) is already booting both the OS, as it should. It's just windows doesn't acknowledge Ubuntu. – WLC Mar 14 '16 at 16:07
  • bcdedit entries "Firmware Application (101fffff)" should be visible in Windows menu Advanced Startup Options->Use a device – hakuna_matata Mar 15 '16 at 21:41
  • bcdedit entries "Windows Boot Manager" as I used in my guide are not visible in this menu but the main function is to insert an entry to EFI menu of your firmware and change boot order if necessary – hakuna_matata Mar 15 '16 at 21:51
  • I tried the above commands. It indeed added a new entry, but adding it as first one (/addfirst) does not seem to be effective. It still boots Windows by default instead of grub. – fviktor Jan 04 '17 at 22:24
  • The Makers of easyBcd say: ”If your Windows PC is booting in EFI mode, Microsoft has blocked the loading of [...] This means that you can no longer use EasyBCD to add Windows 9x, XP [or] Linux entries.” – So I understand, with UEFI neither EasyBCD tool nor bcdedit will make this possible? Or am I missing something? (and I keep reading bcdedit /set {UUID} path \EFI\ubuntu\grubx64.efi accross the net, strongly sound like it is possible... – Frank N Aug 27 '19 at 07:18
  • Not work for fedora 38 workstation. It seems you still need to tell bcd where the core image of fedora is. – Nick Dong May 13 '23 at 18:12
  • I had to quote the identifier, otherwise it gives me a syntax error: bcdedit /set '{748e0a19-dbd3-11ee-a5c1-806e6f6e6963}'. Am I the only one seeing this? None of the examples I've seen thus far are quoting it. I'm using Windows Powershell in Windows Terminal. – Douglas Silva Mar 09 '24 at 22:12
5

The easiest way for your intention should be EasyUEFI. EasyUEFI can create an entry for Ubuntu. \EFI\ubuntu\shimx64.efi is the right file path for that entry. If necessary, you can also change the boot order.

ngng
  • 463
  • I do not have an Ubuntu folder under windows. – WLC Mar 14 '16 at 16:05
  • @WLC The folder \EFI\ubuntu is on the EFI partition. The EFI partition is hidden under Windows, but EasyUEFI should also see this hidden partition. – ngng Mar 14 '16 at 20:56
0

adding to @hakuna_matata 's answer you should execute :

for other os default

bcdedit /displayorder {guid_of_os} /addfirst

for windows as default

bcdedit /displayorder {guid_of_os} /addlast

syntax

bcdedit /displayorder <id> [...] [ /addfirst | /addlast | /remove ]

you will get Ubuntu during boot on options

theCNN
  • 11