Dell XPS 15 9560

Macbook Pro performance for half the cost.

Status
As of late January 2018 I have pretty much everything working as required. Latency on all operations even in X11 are noticeably lower and more pleasant than even typing in iTerm2 on a top end Macbook Pro, and root on ZFS is awesome :) Some annoyances remain:
 * I am still tweaking the graphics setup as I have no need for high performance 3D but do require basic 3D acceleration and would like to have the Nvidia chip disabled. After trying the closed source Nvidia drivers I have switched back to the i915 kernel drive and firmware (not yet detailed in the kernel setup section) and this works well both in console and X11.
 * The synaptics touchpad needs more work. If I am editing in a terminal in X11 it has a tendency to scroll which is irritating. Have tried to turn it off a few ways and yet to solve it to my satisfaction.
 * I am still migrating from raw alsa to portaudio, which seems to be a requirement to get audio out of some applications (eg. love2d applications)
 * ZFS root required submitting a pull request to genkernel which is yet to be accepted (but is working for me). It also for some reason (I suspect because the cachefile would be placed on the initramfs if it was honored) fails to persist the zpool cachefile settings which means every time I rebuild the kernel I need to re-set the zpool cachefile in order to have it cached on the initramfs otherwise the zpool import time blows out to 30 seconds or so while it searches all devices. (My patch fixed this but doesn't auto-generate the cachefile as mucking with low-level storage settings seems a bad thing to silently do)
 * Machine seems to turn on sometimes when in transit without encouragement. There may be something about the ACPI shutdown that could be altered to make it less sensitive to apparent bumps and openings while being carried, or perhaps this is a hardware issue.
 * Haven't yet tried the touchscreen or fingerprint reader or SDcard reader features, though the latter seems to be loaded in to the kernel fine.

History
This device was apparently released in late 2016. I bought it before Christmas 2017. At the time, the cost was about $1900 USD in Australia, versus $3500+ USD for an equivalently specified Macbook Pro with useless features like "touch bar".

When my second overpriced Macbook Pro in a row developed annoying hardware problems that required spending stupid money to resolve, I determined that I should switch away from OSX and return to the Linux desktop fold, as well as to reward Dell as the XPS series is widely considered to be quite Linux friendly.

Standard
Regarding the unsupported fingerprint reader, according to arch wiki, "The fingerprint reader is a Validity/Synaptics model with USB id 138a:0090. There currently is no Linux driver but an open source Linux driver is being developed by reverse engineering the Windows driver.". This implies some or earlier versions have the 138a:0090 version, which a driver is now functional for, however mine has the 138a:0091 version, which is unsupported. See driver development github repository for further information.

Accessories
Some models have touch screens. Some models are 2-in-1 (break apart). I tested on a conventional (non break apart) model with touch screen, however the touch screen has not been tested. A dock exists however I have never seen it and wouldn't personally make use of it. Other reports have described docks in this series as functional, however.

Goals
A philosophical question would be: "Why buy new hardware if we aren't going to use the latest and greatest in software features?" Therefore, we are going to push the boundaries of the possible by setting up a ZFS root partition, because from past experience this will save time later.

Booting Linux for the first time

 * First, create a bootable USB with a ZFS enabled. The easiest way to do this is as follows.
 * Install UNetbootin (from its homepage)
 * Plug in any USB mass storage device (aka. "usb key") with a decent size (16GB+) that you don't mind wiping (all data current stored on the device will be lost!)
 * Start UNetbootin
 * Select the latest Ubuntu Live DVD image Unetbootin-ubuntu-livedvd-download.png (I used Ubuntu 18.04)
 * Let UNetbootin download and install it on to the USB mass storage device
 * Now you have a bootable Linux mass storage device with ZFS support
 * Enter BIOS. Turn on the Dell XPS 15 9560 laptop and press F2 repeatedly.
 * Disable secure boot
 * Enable legacy boot
 * Switch the NVMe internal flash unit to AHCI mode
 * Plug in your bootable Linux mass storage device with ZFS support
 * Save changes and exit
 * The system should now boot to the Ubuntu live DVD boot menu.
 * Press the arrows to select the 'Try ubuntu' option
 * Press tab in order to edit the options
 * Before the final add one more option, nomodeset . This prevents crashing when starting the GUI.
 * Press enter to boot.
 * Open a terminal.
 * Become root via

Remove Windows 10
First of all we want to wipe all the pre-installed Windows 10 junk and recovery partitions.


 * The internal SSD drive will appear as, and it contains needless Windows 10 recovery partitions.
 * Using a partition management tool such as or  delete all of the current partitions. For example, using  we would run  then delete all partitions, write the new partition table and exit. The disk should only show "free space" when we are done.
 * ZFS will use the whole drive, so no partitions are required. Note that even though we use the whole drive ( represents the whole drive and not a partition), ZFS has a smart design that means there is still space for a Master Boot Record (MBR), so we can install a boot loader on the disk without causing damage to the ZFS data.

Connect to the internet
Now we want to connect to the internet.
 * Click the down arrow in the top right, and choose 'Select Network' beneath 'Wi-Fi Not Connected'.
 * Enter your local wireless network information.
 * Verify that the wireless network connected by clicking the down arrow in the top right again. If connected, it should now show the network name.

Install ZFS
Now we want to tell the Ubuntu Live DVD to get ZFS support.

We now tell it to fetch updated package information from the internet:

This will take some time to download updates.

Finally, we install the ZFS support.

Create ZFS root dataset
This is where the root filesystem will live.

Create additional ZFS datasets
Optional.

Make the root filesystem bootable
To do this, we set the ZFS pool's property as follows.

We then verify the setting.

Populate the root filesystem, create kernel + initrd (initial ramdisk)
First install links.

Now follow the standard installation procedure in the Gentoo AMD64 Handbook, until you reach the section titled Configuring the bootloader, then return to this guide.

Note that when setting up the kernel:
 * Not all kernel versions are supported by ZFS on Linux
 * Because ZFS on Linux is therefore going to limit which kernel version you can install, the best way to select a kernel version is to install the very latest ZFS on Linux (and which is a Solaris porting layer) and work backwards from there, ie.


 * Some version of the kernel sources should now be present in and you can use that to configure your system.
 * After you have built the kernel, run to place it in . This will ensure naming conventions are followed which will later allow  to detect the kernel.
 * Once configuration is complete, feel free to use to generate an initial ramdisk  as follows:


 * The ramdisk will be installed to in such a way that  can detect it.

Install grub2 bootloader
In order to boot from a ZFS filesystem we need to install a version of the boatloader with  enabled.

Let's just install the absolute latest version.

Once the grub program is installed on the system, we double-check that can see our ZFS volume.

If you run in to issues, try copying the `zfs` device file from the host to the chroot as follows:

Now we want to configure it to support ZFS.

Now we generate a configuration file.

Double-check that the generated configuration file includes an instruction to load the ZFS module.

Now double-check the ZFS module is in place.

Finally, we can tell it to install at the beginning of the NVMe disk.

Preparing to reboot
First install networking stuff you may have forgotten.

Don't forget to set a password!

Exit the environment.

Unmount the various filesystems.

Double check the ZFS property is correctly set for the root partition.

Now reboot, being careful to remove the live USB once the machine resets to enable booting from the internal NVMe flash.

Firmware
BIOS version on receipt was  with.

We need the package to operate the wireless chipset and to provide firmware to upload to the Intel graphics controller to enable things like proper power management.

make.conf
We want to enable a few things in ...

Touchpad
Synaptics touch pad.

You can tune this with a tool, see the arch linux page on synaptics touchpad for more details.

Bumblebee / Primus
Hyrbid Graphics (GPU Switching) is available on the XPS 15 9560. Follow the Gentoo Bumblebee Wiki guide to installing it.

Slow 2D graphics
According to this page slow 2D performance attributed to a BIOS setting can be identified via:

If any line contains the word "uncachable" apparently you need to reboot, enter BIOS, and change an MTRR setting from 'continuous' to 'discrete'. However, on my machine while this is certainly the case, I cannot find such an option in the BIOS.

Interrupted setup
If your setup is interrupted for whatever reason, you can re-mount the ZFS root dataset as follows.

You then want to ensure the other mounts have not been made in the host.

Then re-enter the environment.

Then re-mount the other datasets.

When you are done, before you reboot, be sure to set the mountpoint back to root.

X11 fails to start with "No Screens Found"
This can be because you have enabled the  EFI Framebuffer Driver in the kernel. Disable it. Only  (Simple Framebuffer) is OK to leave enabled!

Crash on X11 startup
This can occur you have the  driver enabled. You can work around it by adding nomodeset to the kernel command line.

External resources

 * https://www.anandtech.com/print/11670/the-dell-xps-15-9560-review-infinity-edge-part-two
 * https://wiki.archlinux.org/index.php/Dell_XPS_15_9560
 * https://www.funtoo.org/index.php?title=ZFS_Install_Guide
 * https://github.com/strelec/dell-xps-15-kernel-config
 * https://browser.geekbench.com/geekbench3/8250863
 * https://forums.gentoo.org/viewtopic-p-8114160.html
 * https://grahamc.com/blog/nixos-on-dell-9560