43

I have an HP 500-413nl (a desktop) and Windows 10 keeps changing the boot order in UEFI/BIOS every time, so that if I want to boot Ubuntu 16.10 (64-bit) I always have to press F10, thus entering the BIOS setup and changing boot order…

Is there a workaround for my PC? What should I do? I'm a little desperate.

P.S.: I have already disabled "Secure boot" and "Fast/quick boot" in the BIOS and "Fast startup" in Windows options / Control panel.

  • Did you change the boot order in the UEFI/BIOS settings? I had to change the boot order sequence for the drives after creating the dual-boot setup. I'm using an MSI laptop, not HP. – code_dredd Oct 18 '16 at 14:22
  • Did you try renaming the bootloader and change the label to exactly match the Windows version? That might make things stick, at the cost of making the manual boot more confusing. – ubfan1 Oct 18 '16 at 15:43
  • Some HP have a "Customized" boot buried pretty deep in settings: https://ubuntuforums.org/showthread.php?t=2332681&p=13527216#post13527216 and one of later answers: http://askubuntu.com/questions/244261/how-do-i-get-my-hp-laptop-to-boot-into-grub-from-my-new-efi-file – oldfred Oct 18 '16 at 15:49
  • @ray Yes, I did – JK andy-drew Oct 18 '16 at 15:54
  • @JKandy-drew Dumb question, but did you save the changes at UEFI? I just don't see a reason why Windows would be modifying UEFI/BIOS settings without you asking it to do it (if possible), but I wouldn't be surprised if it's really doing that.. haven't come across this problem. – code_dredd Oct 18 '16 at 16:30
  • @ray Yes, I saved the changes and also double-checked – JK andy-drew Oct 18 '16 at 16:56
  • For example, I just rebooted to double-check if there was a "customized" option deep in the settings, but none was found: well, now I found the boot order was "ubuntu" etc. and Windows Boot Manager disappeared… – JK andy-drew Oct 18 '16 at 17:10
  • @oldfred, which are the steps I should follow? – JK andy-drew Oct 18 '16 at 17:12
  • On of the other options is to boot the fallback or hard drive entry which is /EFI/Boot/bootx64.efi and usually says UEFI hard drive or something similar. May have to create UEFI entry. Or use rEFInd. Sony, HP & others: http://askubuntu.com/questions/486752/dual-boot-win-8-ubuntu-loads-only-win/486789#486789 Some answers may say to copy over the Windows bootmgfw.efi boot file, best not to. Boot-Repair will copy shimx64.efi over, but does not add an UEFI entry.https://askubuntu.com/questions/597052/can-not-boot-anymore-after-a-boot-repair – oldfred Oct 18 '16 at 18:30
  • Thank you @oldfred, it really seems the first link is my solution, the only problem is that is a bit difficult for me to execute (as you've explained in the answer to #486752), could you please guide me step by step? Sorry for my English, I'm not a native speaker. Some passages are tricky and I don't want to damage my system, since i don't use very much the terminal. – JK andy-drew Oct 18 '16 at 19:47
  • (I mean the "I" paragraph til "2.") – JK andy-drew Oct 18 '16 at 19:52
  • Each command in grey is what you can run. But Boot-Repair does all that now. Boot-Repair now creates bkpbootx64.efi and copies shimx64.efi as bootx64.efi. This is a hard drive default or fallback boot entry in UEFI. 'Use the standard EFI file' in advanced options. https://bugs.launchpad.net/boot-repair/+bug/1531178 Then the only issue is if on cold reboot whether UEFI finds standard/fallback folder and auto adds it to UEFI boot menu or if we have to manually add that. – oldfred Oct 18 '16 at 21:38
  • OK :) , what program would you suggest to me to create a USB pen with boot-repair? Once I used the pre-installed "Boot disk creator" (in Italian, the language of my system, is "Creatore di dischi di avvio", I hope the translation is correct) and my system didn't recognize it… UNetbootin? – JK andy-drew Oct 19 '16 at 15:32
  • @oldfred, pardon me, I didn't notify you… – JK andy-drew Oct 19 '16 at 16:19
  • I think any Ubuntu flavor works. Whatever you used to install Ubuntu should be the version your use. Use the add the ppa method. https://help.ubuntu.com/community/Boot-Repair – oldfred Oct 19 '16 at 18:06
  • @oldfred I used boot-repair, however when I rebooted from Windows 10, it went directly into Windows; here is the boot-info: http://paste2.org/mc9FLM2F – JK andy-drew Oct 19 '16 at 20:28
  • Grub menu may have too many options or all the HP entries. http://askubuntu.com/questions/778663/what-is-the-difference-between-windows-uefi-bootmgfw-efi-and-windows-uefi-bkpboo/778705#778705 You may need to run this to add an entry to boot hard drive or bootx64.efi entry: sudo efibootmgr -c -g -d /dev/sdX -p 2-w -L "UEFI hard drive" -l '\EFI\Boot\bootx64.efi' I changed settings to match your ESP of sda2. see man efibootmgr for details of parameters. – oldfred Oct 19 '16 at 22:43
  • @oldfred I encountered some problems: now my Grub is like that (practically doubled the entries in the menu): 1. https://drive.google.com/file/d/0BzDVdpXZTpRXLXB6b0pjTXl6ME0/view?usp=sharing 2. https://drive.google.com/file/d/0BzDVdpXZTpRXQTFUQ2RWRlM4ZkU/view?usp=sharing Also, when executing sudo efibootmgr -c -g -d /dev/sdX -p 2-w -L "UEFI hard drive" -l '\EFI\Boot\bootx64.efi' it gave me this output: efibootmgr: Could not set variable: No such file or directory efibootmgr: Could not prepare boot variable: No such file or directory – JK andy-drew Oct 20 '16 at 18:01
  • Boot-Repair creates 25_custom with all the extra HP .efi files. You do not need most or may not any. To House clean: http://askubuntu.com/questions/778663/what-is-the-difference-between-windows-uefi-bootmgfw-efi-and-windows-uefi-bkpboo/778705#778705 But it looks like you have more than one copy of 25_custom?? And Boot-Repair should have created bootx64.efi, but you need to tick/check the advanced option. Boot-Repair now creates bkpbootx64.efi and copies shimx64.efi as bootx64.efi. This is a hard drive default or fallback boot entry in UEFI. 'Use the standard EFI file' in advanced options. – oldfred Oct 20 '16 at 19:00
  • The problem arose with the third command of four (nano) in this answer, where it gave me a text editor… I'm a little inexperienced of Linux commands, what should I have done? Saving the text with Ctrl-O? (I just learned now with a Google search what's "nano") – JK andy-drew Oct 21 '16 at 15:00
  • Same problem for me, it seems that UEFI is to force user to use Windows. Terrible! – MaxV Dec 27 '20 at 11:43

4 Answers4

47

I also faced the same issue that Windows 10 (Education) automatically, on startup, moves the Windows Boot Manager EFI entry to the top again. If I changed it, after restarting with Windows, the next boot skipped Grub and directly booted into Windows. This is how I sovled it:

I would recommend the tool EasyUEFI http://www.easyuefi.com/ to view and change some EFI related settings.

  1. Open the tool and select Manage EFI Boot Option

  2. Take a loot at the exiting entries. The two important ones for me are:

    Description:Windows Boot Manager
    GPT partition GUID:{505E666C-00CD-4654-BB80-FBD2C6F9F191}
    Partition number:2
    Partition starting sector:923648
    Partition ending sector:1128447
    File path:\EFI\Microsoft\Boot\bootmgfw.efi
    

    And:

    Description:Ubuntu 16.04
    GPT partition GUID:{505E666C-00CD-4654-BB80-FBD2C6F9F191}
    Partition number:2
    Partition starting sector:923648
    Partition ending sector:1128447
    File path:\EFI\ubuntu\grubx64.efi
    
  3. The next step is to make sure that Windows does not use its own bootmgfw.efi file again, but rather grubx64.efi. To do so, don't move an Ubuntu EFI entry to the top again (i.e. that's the problem we have), but just set the file path for the Windows Boot Manager to \EFI\ubuntu\grubx64.efi. You can also do this from the administrator command line:

    Bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi
    

    Now, Windows should not change the EFI settings anymore and on every boot, GRUB is the default. As GRUB ideally already identified your Windows OS, it also contains its value in the grub settings.

Zanna
  • 70,465
patzm
  • 586
  • 1
    If Grub is not configured properly, refer to this or this post to add Windows to Grub, as you can now boot into Ubuntu again. Sorry, but due to insufficient reputation, I could not provide more than 2 links in my response. – patzm Jan 07 '17 at 15:06
  • It solved! Thank YOU and ALL who contributed, finally I understood it's a Windows problem/issue (not Linux), and overall I hope this could help others having the same trouble. :)

    Just use the last command @maddin25 reported.

    – JK andy-drew Jan 07 '17 at 21:47
  • WARNING!!! May cause a boot manager collision in BIOS! See this question – Kartik Aug 14 '17 at 18:44
  • 3
    @Kartik my post above concerns UEFI and not BIOS, which are two different things (see here) – patzm Aug 16 '17 at 09:13
  • Yes. I should have written "during POST". Instead I wrote BIOS, and didn't see it until now. – Kartik Aug 16 '17 at 15:13
  • 2
    This is Shareware right? Anybody know a free tool for this? – Blackbam Nov 22 '19 at 15:42
  • 1
    My god thank you so much, I was pulling my hair out from having windows destroy my efi config every time it was updating. – Hannes Landeholm Jul 24 '21 at 20:51
  • 1
    I got it to work on Windows 11 (22H2 build 22621.1194) and Ubuntu 22.04.1. Another answer said to use bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi, but that showed a warning right before GRUB had loaded whereas using …\grubx64.efi worked great out of the box. Many thanks! – ilyakam Feb 03 '23 at 22:07
  • 1
    @Blackbam Maybe the editor in the free edition of Disk Genius suits your needs – Enno Apr 29 '23 at 12:59
9

I had this problem and solved it by setting a password in the UEFI/BIOS for accessing it. Apparently, when a password is defined, windows can no longer make changes in the UEFI/BIOS. The computer is a Lenovo.

Aquinas
  • 91
4

My Sony laptop was also changing the boot order upon start-up. Another alternative that worked was to use EasyUEFI to disable the Windows Boot Manager EFI entry.

This left the existing Ubuntu boot option as the highest active.

KT12
  • 235
0

I executed this on windows, so windows uefi will boot into grub:


 bcdedit /set '{bootmgr}' path \EFI\ubuntu\grubx64.efi

piotr
  • 121
  • 3