Ubuntu Linux on the HP Spectre 13 x2

Since this laptop is new and I’ve found it to be something of a challenge to get Ubuntu working on, I decided to document what I had to do to get it working.  Hopefully this will be helpful to others installing linux on this laptop.

For reference, my goal was to get either Ubuntu or Kubuntu working on this laptop to the best of its ability.  I started this task in November 2013 so I’m using 10.13 as the latest versions of each.

UEFI & Safeboot

Until I’m completely happy with Ubuntu/Kubuntu I’ve decided to keep windows 8.1 around.  With the new UEFI and Safeboot this turns out to be a bit of a challenge unless I want to completely reinstall windows 8.1 in legacy mode (which I don’t at the moment).

I started by disabling safeboot in the bios.  This (apparently) is necessary, however it does make Windows 8.1 put a text watermark complaining about the lack of safeboot in the lower right corner.  I hear that this does not harm anything, so far that seems to be true.

Next, per some guides I found on the net, I disabled “fastboot” in windows under the power management control panel item (search and you can find out how to do this).

Next, per some net guides, I asked Windows to shrink it’s C: drive to make space for the Ubuntu install.  This allowed me to shrink the C: partition to ~50GB leaving ~50GB for linux.  I understand that doing this from windows makes UEFI happy in some way I don’t fully understand…

At this point, I was able to install Ubuntu from a flash drive.  The one caveat is that I found that without changing the grub linux boot options, booting off the Ubuntu flash disk would always end up with a blank screen (see my section about backlight below).  I was able to get past this by editing the grub linux boot options (e from the grub boot select screen) to add “nomodeset”.  Once this was done I was able to install Ubuntu into the free space without too much problem. Upon reboot, however, the system went straight into Windows without any grub menu showing up.

Some digging found that, although the bios is set correctly and Ubuntu does support UEFI booting, the HP bios will only give you the option of booting Ubuntu if you hit F9 (boot menu) during boot and then select the Ubuntu partition (which then gives you the Grub boot menu).  This is annoying but to make it less so I set the bios to give 5 seconds wait time before booting and now I can hit F9 and boot to Ubuntu (through two redundant menus).

Backlight

The next big challenge was dealing with the backlight.  Although I can technically boot into Ubuntu with the method described above.  As soon as boot starts the screen goes blank and never turns back on.  I found that if I put a bright light on the screen that the screen was actually on but that the backlight was not.  Plugging in an HDMI monitor worked fine but the eDP1 display was always blank.  After much trial and tribulation, I ran across this page, which details how to deal with this problem.  Ultimately the problem was fixed by adding “i915.invert_brightness=1” to the “GRUB_CMDLINE_LINUX_DEFAULT” line of the /etc/default/grub file. After adding this line I then ran “update-grub2” to get grub updated.

While this makes the screen visible, it does not enable the brightness function keys to work.  After some effort, I gave up trying to make the brightness keys work directly and instead installed xbacklight.  I then mapped Alt-f2 and Alt-f3 to xbacklight +10 and xbacklight -10 respectively.

Update: With some help from the Ubuntuforums, I changed the linux kernel options as follows (backing out the invert_brightness above) and now brightness works as expected, though the brightness keys still do not work:

GRUB_CMDLINE_LINUX_DEFAULT="quiet rw"
GRUB_CMDLINE_LINUX="acpi_osi=\"!Windows 2012\""

WIFI

My HP Spectre 13 x2 ships with an Intel N 7260 Wifi card.  I was hopeful that since Intel generally supports Linux fairly well, I would be able to get this to work.  Although it did not work with the initial linxu install I ran across some notes that the driver needed to be upgraded.  I’ve ran through process of installing a new driver from the backports set from this link with no initial success.

Next, I added acpi_osi=” to my grub linux cmdline (as with invert brightness above) in my effort to get the brightness keys working and this seemed to have had the effect of enabling the F12 WIFI kill switch.  Toggling that has allowed me to perform a successful WIFI scan with the built in wireless card.

Once I got iwlist scan working with wlan0, I still had some problems getting network manager to see the card so I decided to see if WICD would be a better network manager than the default one.  I installed this following the instructions on the Ubuntu WICD page, but I hit the infamous D-Bus problem on login.  This was fixed by removing and re-linking resolv.conf as described here.

After this, I was able to get WIFI started using the wicd-gtk interface and I finally got a webpage to load!!

Update 12/13/12: While I was able to get things working partially with wicd, it wasn’t very consistent and I could not get my wired USB ethernet to work with it.  With network manager I was able to get the wired ethernet working so I reverted to network-manager.  For WIFI, I’ve found it seems to work best when I manually use wpa_supplicant since network-manager cannot enable it for now.  Even with wpa_supplicant however, it is very unstable and I regularly lose my connection and have to remove and re-modprobe the iwlwifi modules.  More hacking to do…

Update 12/16/13: I’ve received some good help on the Ubuntuforms (see thread here).  The upshot is that apparently part of the problem with getting network-manager working was that (for some unknown reason) the acer_wmi kernel module was getting loaded instead of the hp_wmi.  Apparently acer_wmi places a permanently “soft” blocked wifi in the rfkill list which confused NM into thinking that wifi was disabled.  When acer_wmi is blacklisted the correct hp_wmi is loaded and this problem goes away allowing NM to work properly.  That said it did not fix my stability problems.

Fixing the stability problems seems to have required a combination of a 3.12.5 kernel and a new revision of the 7250 ucode firmware (22.1.7.0) which I found on this site.  I replaced the file in /lib/firmware/ and the WIFI is solid across time and suspends.

Now WIFI appears stable and works with NM!

“Special” Keys

The special keys for volume up/down, WIFI kill switch and etc. seem to working more or less “out of the box” with the latest kernel once I blacklisted “acer_wmi” and which allowed “hp_wmi” to load.  The caveat to this are the brightness keys, which currently do not do anything and xev seems not to notice.  I worked around this for the brightness setting by mapping CNTR-F2 and CNTR-F3 to brightness up and down which works well enough for now.

Synaptics Touchpad

The touchpad on this device is made by Synaptics and has multi-touch functions, however under linux it appears to only be viewed as a basic mouse.  The “Touchpad” configuration program in KDE does not recognize it as a synaptics touchpad so I have posted a question about it to the Ubunutforms, hopefully someone will be able to help out in getting that working.

Things that work out of the box:

  • Suspend – suspend to ram works great (AKA sleep).  No problems from the beginning.  Haven’t tried suspend to disk.
  • Sound – seems to work perfectly with 3.12.5.  I remember some problems after suspend with an earlier kernel

TBD

Other things to work on when I have time:

  • Battery – Currently it looks like I’m getting nowhere near the battery life in Linux that I do in Windows, though I do have the laptop-mode-tools installed.
  • Accelerometer – Currently no support for this and no clue how to get it working.

If you have questions, comments or other info about installing Linux on this laptop feel free to contact me at pgratz@gratz1.com . Please put “Linux” and “Spectre” in the subject somewhere so I know what it is about.