I recently bought a new HP computer, it is running on Windows 10 and I installed Ubuntu 16.04, but everytime I turn on the PC it goes straight to Windows, so how can I fix this to set up grub at the boot time. I can access Ubuntu from Windows Advanced Restart settings, but that's the only way. I have disabled the secure boot on the bios and the fast startup for Windows but it didn't work.

  • See: Sony, HP & others: askubuntu.com/questions/486752/… And running Boot-Repair now does copy of shimx64.efi to bootx64.efi to boot fallback or hard drive entry. HPs do not let you directly boot Ubuntu entry in UEFI. Grub only boots working Windows, so have both Windows repair disk & Ubuntu live installer available as Windows updates may turn back on Fast Start-up. askubuntu.com/questions/843153/… Is Ubuntu in UEFI boot mode? Or are you rebooting into BIOS boot mode? – oldfred Jun 7 '17 at 20:05

This issue can be resolved by installing boot-repair package by following these steps:

1) Open a terminal and run these commands:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update
sudo apt-get install -y boot-repair

2) Then run boot-repair by sudo boot-repair and use "Recommended repair". Then boot-repair will scan boot paths and correct them and update your grub configuration and set grub as the default bootloader of your system.


Run this from windows command prompt

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


efi expects the default boot loader to be /efi/boot/bootx64.efi. windows is particular about making sure it boots.

fist off, from 8.1 on windows does not really shut down, it suspends to disk ( like a hibernate) so that it boots faster. second it changes EFI to make entry 0000 (windows) first in the boot order.

the work around: rename grubx64.efi to bootx64.efi then replace the file efi/boot/bootx64.efi.this makes grub the default boot loader.

second: when in ubuntu, use efibootmgr to delete all efi entries. and reboot your computer. Make sure the first system you boot into is ubuntu so that it is placed in entry 0000. then boot windows.

third: some bios updates look in MBR for a loader even though it is a gpt/efi disk. I assume this is a compatibility issue (upgrades from a MBR formated disk). windows will have a loader there. Install grub to the MBR as well as doing the above.

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.