HP pavilion x360 and Linux, dual boot with Windows 8.1 (part 1)

I have an HP Pavilion 11-n030ar x360 Notebook (see http://support.hp.com/us-en/document/c04439109 for the specs) and I faced two major problems when trying to use Linux (any distribution, but let’s say Arch in particular). Thanks to duckduckgo/google I know that other laptop users have faced and will face the same problems so I hope that I can help them.

The first difficulty, assuming you want to install Linux alongside Windows 8.1 in uefi mode, is that the machine will boot Windows 8.1 before anything else, so no way to access Grub or Gummiboot, etc. Well there’s a way that’s cumbersome, it’s to go into the uefi settings from Windows and then pick an option (F9 on my machine) to choose grub, to boot into Linux. But to really install it like it should be, you must go through a hack.

It seems like HP firmware wants to boot Windows no matter what, so the hack consists in renaming a linux.efi file into bootmgfw.efi and move it where the windows efi file is (and replace it) so that HP will boot Grub first, thinking it’s Windows.

I’ll assume from now and on that you have disabled secure boot and fast boot in Windows and that you have installed Linux on your hard drive. Install efibootmgr and grub.

Using the command “efibootmgr -v“, check the path of bootmgfw.efi (that’s the Windows efi file that HP uses to boot the machine) and check the grubx64.efi file from Linux. Now rename bootmgfw.efi into for instance bootmgfw.efiold. With the comandline, to do so you can do: “# mv /path_to_bootmgfw/bootmgfw.efi /path_to_/bootmgfw.efiold“. Now rename the grubx64.efi into bootmgfw.efi and move it to the path where bootmgfw.efiold is. You can do for example “cp path_togrubx64/grubx64.efi path_to_bootmgfw/bootmgfw.efi“. Now a reboot should bring Grub instead of Windows. The problem is that choosing Windows won’t boot it. For it to boot properly you’ll need to create the file /etc/grub.d/40_custom and place in it the part in the file /boot/grub/grub.cfg that refers to Windows (that is, the part that beings with “menuentry ‘Windows …’ which is situated between ### BEGIN (path) ### and ### END (path) ###. Once done, regenerate the grub.cfg file with “# grub-mkconfig -o /boot/grub/grub.cfg“. Now the whole problem should be fixed and you should be able to dual boot with Windows 8.1 normally.

Sources: https://askubuntu.com/questions/235567/windows-8-removes-grub-as-default-boot-manager, https://xpressubuntu.wordpress.com/2014/04/14/how-to-reinstall-grub-after-windows-8-1-upgrade-on-a-hp-pavilion/.

See part 2 to see the other problem I faced.

Advertisements

2 thoughts on “HP pavilion x360 and Linux, dual boot with Windows 8.1 (part 1)

  1. That works, but it is now (July 2016) easier to change the priority of efi boot entries on the “BIOS” menu (under boot options).

    I was able to define grub-2 as the default bootloader, (which has the ability to boot linux or chainload the microsoft bootloader). You first need to upgrade the netbook’s firmware to the latest version.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s