Ubuntu – How to make Ubuntu the default boot option on a newer laptop (UEFI)

bootgrub2uefiultrabook

I have a HP Spectre XT that I installed Ubuntu on. I have turned "Secure Boot" off and turned on "Legacy Support" in the settings. This laptop has UEFI and it always boots to Windows 8 rather than the GRUB menu. To boot Ubuntu, I have to go to "select boot device" and select the "ubuntu" option, which will take me to the GRUB menu.

How can I get it to boot into Ubuntu by default?

Best Answer

I strongly suspect that you have not installed Ubuntu in BIOS mode. The reason I say this is that you report that your "select boot device" boot menu has an option called "ubuntu." If you were booting Ubuntu in BIOS (aka CSM or legacy) mode, this wouldn't be the case; the option would say "boot from HD" or some such generic description, since the firmware would have no way of identifying the BIOS-mode OS as being Ubuntu. In an EFI-mode boot, though, this information is stored in NVRAM, and so is available to the EFI's boot manager.

To be sure of this, boot Ubuntu and look for a directory called /sys/firmware/efi. If it's present, you've installed and booted Ubuntu in EFI mode. If it's absent, you've probably booted in BIOS mode, although there are ways to make that directory disappear from an EFI-mode boot, so I can't be positive of that.

If I'm right, then something is preventing GRUB from turning up as the default boot loader. Chances are this is because of a bug in HP's firmware; I've heard of other HP computers that have the same problem. There are quite a few possible workarounds. I recommend you try these two, in order:

  • Boot to Windows and open an Administrator Command Prompt window. Type bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi. If this works, GRUB will come up the next time you boot. (Note that you should type {bootmgr} in exactly that way; I'm not trying to denote a variable with the curly braces.)
  • In Linux, run the Boot Repair tool. This will do some juggling of boot files, which should make GRUB come up by default. Note that this approach is rather heavy-handed and the change may be undone by Windows -- very likely after certain system updates, and some users have reported after every boot. Still, this method often works for extended periods.

If neither of these approaches works, post back, along with the output of sudo efibootmgr -v and df -h /boot/efi. This extra information will enable me to make additional suggestions.