Malachi Soord In a beautiful place out in the country

Setting up Ubuntu 16.04 on a Dell XPS 15 (9550)

I recently received a Dell XPS 15 (9550) as a replacement for an older XPS 15 which has some unresolved USB issues. At work I have been using Ubuntu as my workstation and I wanted to replicate this setup at home.

Backup Windows licence

The first thing I did was to backup the Windows licence information for the case when I ever did decide to go back to Windows land. For this I used ProduKey from NirSoft.

Installing Ubuntu 16.04

Next you will need to create a bootable USB installation which can be achieved in a number of ways depending on your platform. On Widows I would recommend Rufus but for a crossplatform solution there is UNetbootin.

Once setup the USB installation process was relatively pain free and the system was installed within a matter of minutes.

Improving display

The default settings on this 4K screen look far to small for my eyes. You can adjust this in the display settings by changing the scale factor. 2 works well for me but it’s a personal preference.

Enabling bluetooth

I soon noticed that bluetooth was not working and researched a bit on how to fix this and it seemed to point to a missing firmware file. The file can be obtained here. Once downloaded copy to /lib/firmware/brcm/ and reboot the system.

Missing firmware

When installing the latest kernel I noticed it was complaining about missing firmware files when doing an initramfs rebuild.

W: Possible missing firmware /lib/firmware/i915/skl_guc_ver6.bin

A quick look online took me to this thread which suggested downloading the latest firmware from Intels website and following the instructions there.

Setting up nvidia

Out of the box the nvidia GPU drivers are not installed. You will have to disable secure boot from within the BIOS to enable the installation of 3rd party drivers.

At the time of writing the current stable drivers for the GeForce GTX 960M is the nvidia-375 series. To obtain these you must setup the nvidia ppa.

sudo apt-add-repository ppa:graphics-drivers/ppa
sudo apt update

And then you can install the drivers and nvidia prime that will enable you to switch between GPUs within the Nvidia settings application.

sudo apt install nvidia-375 nvidia-prime

Along with installing the nvidia drivers I recommend installing prime-indicator too as it’ll enable you to switch between the Intel and Nvidia GPU easily from within unity.

sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update
sudo apt install prime-indicator

However switching does require a whole login/logout cycle which makes switching a bit of a pain. Others have setup bumblebee and enable the dedicated GPU on a per app basis. I’ve not had a chance to explore this setup yet.

Troubleshooting

I’ve noticed previously that sometimes the display drivers fail to load correctly and upon boot you’re greeted with a black screen. To revert these changes boot into a kernel recovery mode and run apt remove nvidia-* and reboot. More information can be found here.

Changing function key behaviour

The default behaviour for the function keys is reversed to what I would expect. For example pressing F1 would mute the audio. Thankfully this can be switched by pressing fn + esc.

Fixing backlight issues

I’m not sure if this issue was when I fresh installed or when I upgraded the BIOS of the laptop, but I noticed the brightness controls not working. I found a post on the Ubuntu forums which talked about this and provided a solution.

sudo nano /lib/systemd/system-sleep/97fixbacklight

and pasting the following:

#!/bin/sh
# From patchwork.freedesktop.org/.../
# and en.community.dell.com/.../19985320
# Suspend Resume fails to restore PWM_GRANUALITY
# Based on script by Tony.Jewell@Cregganna.Com


INTEL_REG=/usr/bin/intel_reg
ADDR="0x000c2000"
SAVE_FILE=/var/lib/systemd/save_intel_reg_pwm_granuality


[ -x "$INTEL_REG" ] || exit 0


case "$1" in
        pre)
        echo "$0: Saving Intel Register PWM_GRANUALITY"
        "$INTEL_REG" read "$ADDR" \
            | (read addr value && echo "$value") \
            >"$SAVE_FILE"
    sync
    ;;
    post)
        value=`cat "$SAVE_FILE" 2>/dev/null`
        if [ -n "$value" ]
        then
            echo "$0: Restoring Intel Register PWM_GRANUALITY $value"
            "$INTEL_REG" write "$ADDR" "$value"
            rm "$SAVE_FILE"
        fi
    ;;
esac

Save the file and reboot and you should have working backlight controls.

Upgrading the kernel

Ubuntu 16.04 ships with the 4.4 version of the kernel. I wanted to use the latest version which at the time of writing is 4.7.3. This can be done by visiting the Ubuntu mainline build site and download to a new directory the following files using either wget or curl.

  • linux-headers-4.7.3-040703_4.7.3-040703.201609070334_all.deb
  • linux-headers-4.7.3-040703-generic_4.7.3-040703.201609070334_amd64.deb
  • linux-image-4.7.3-040703-generic_4.7.3-040703.201609070334_amd64.deb

and installing with sudo dpkg -i linux-*

These steps are applicable for any kernel changes. Just visit the mailine kernel site and download the correct linux-headers and linux-image.

Futher reading