Garten Eden

#linux #programming #android #online #stuff

The HP Spectre 13 with Linux

Having first-class hardware and with its high quality of workmanship, the 13“ Ultrabook from HP is a nice product. It runs neatly on Windows. But how will it score in my Dual Boot System with Ubuntu 14.04 Trusty Tahr?

Installation alias The first UEFI Challenge

If you avoid some pitfalls, Linux will be installed on UEFI systems almost as fast as on BIOS systems. Although the BIOS replacement forces you to strike new paths, it is the future. Altogether new distributions support you in order to make no severe mistakes while installation. Actually I use Linux Mint for quite a time now, but as long it does not support newer kernel versions yet (with all the improvements for Haswell), I stick with the just released version of Ubuntu.

If you want to use a Dual Boot system, you have to disable Fast Boot on Windows so it shuts down properly instead of just exiting the current session and go to hibernation (and no, you won't notice performance regressions). You can manage that in Windows' Energy Options
In order to see the UEFI menu after the restart you can initialize its boot out of Windows. Just hold the Shift key while selecting Reboot. In the upcoming menu you can select Troubleshooting and UEFI.
After some seconds you are able to disable Secure Boot and change the boot priority of your USB device where your Linux live system is stored at. You can disable the BIOS compatibility mode (CSM) here, too, just to be save you boot in UEFI mode.
After that you can install Ubuntu as you know it. Pay attention to the partitioning though. The UEFI parts have to remain untouched. So I just resized the biggest Windows partition and created three new ones for Linux, one for the system with mount point /, one with mount point /home and a swap partition. Then Ubuntu adds itself to UEFI's operating system selection, so that you can choose the system you want to boot when starting your notebook (Esc → F9).
Conclusion so far: Working Dual-Boot.

Setup Linux as the default OS

Initially the system is configured to load Windows when booting and not selecting the UEFI menu. If you want Linux to be the default system, you have to change the boot order.

Actually it is a child's play to achieve that with UEFI—if HP would not violate the standard.

Theoretically there is the option to modify almost everything boot-related with the tool efibootmgr. But there were many hours and many trials until I found out that HP overwrites every change to the boot order after reboot and sets the Windows Loader as first option (related HP support ticket is pending).

Currently there is the only way to get this working by tricking the system. The idea is to copy the Windows starter file bootmgfw.efi out of /boot/efi/EFI/Microsoft/Boot/ to some other place (e.g. to its parent directory) and replace it by the Linux file.

sudo mv /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi /boot/efi/EFI/Microsoft/
sudo cp /boot/efi/EFI/ubuntu/grubx64.efi /boot/efi/EFI/Microsoft/Boot/bootmgfw.efi

This way Grub2 loads every start and offers a selection of all installed operating systems. Windows, too. But as we replaced it silently with Linux (technically it is due to Grub's OS prober script which detects the explicit path and considers it to be a Windows entry). So if you want this entry to be functional as well, you have to reconfigure Grub. Either you manually change grub.cfg and specify the new path (note that direct editing of this file is deprecated) or you insert a new UEFI boot entry for Windows.

Keeping Windows bootable

We need to inform UEFI about Windows' new boot path. There is a tool for that called bcdedit.exe. Running it without arguments it lists the entry stored in your mainboards NVRAM. The following command edits the main entry in a way it points to the new location:

bcdedit.exe /set "{bootmgr}" path "\EFI\Microsoft\bootmgfw.efi"

No surprise that HP's system creates a new useless boot entry…
If Windows keeps booting every system start, it may be necessary to repeat moving the Windows file. For me it worked the second time and I kept wondering about the new boot entries appearing after every change


Having cleared all the hurdles, you get rewarding with a comfortable Dual Boot system.

The Ultrabook itself

By itself the Ultrabook HP Spectre 13 is great. Intel i7, 8GB RAM, a first-class display, a battery life of about 6 hours and a lot more make it a recommendation.

Sadly there are compatibility problems with Linux, too.


Update 06/21/2014: Concerning the problems, please read my updated blog post about the Spectre 13 with Linux.

Update 06/22/2014: After some Windows updates our EFI file gets replaced by the original one. Then you have to run the copy command again in order to make Ubuntu the default boot OS again.


Your comment:

So far... comments


Wait a sec, loading...

Email (not published)

Homepage (optional)

Comment... (code tag allowed)