Ubuntu – see the BCDedit for a Windows10/Ubuntu install both by Wubi and by separate partition

dual-bootgrub2uefiwindows

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?

Best Answer

  • 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 
    
  • Related Question