Dell XPS 13 (9343) with Debian Jessie (8.3)

Posted on

I was an early adopter of the Dell XPS 13 9343 “Developer Edition”. It came with a special OEM install of Ubuntu 15.04 that included support for a few of the laptop’s trickier pieces of hardware (e.g. the Broadcom wireless card). The laptop is an attractive little package. It’s got very narrow bezels, a decent keyboard, and is the thinnest, lightest weight laptop I’ve ever owned. That being said, there are some significant belmishes to this little gem.

First of all, for a laptop billed by the OEM as being designed for running Linux, hardware support is actually quite poor. I’m not going to bother going into details as the evidence for this claim is readily available via internet search. The factory installed version of Ubuntu runs acceptably, but if you are like me, and unwilling to limit yourself to just that distribution, you’ll find that this laptop isn’t your best bet for a Linux based laptop.

Second, and this is a flaw that apparently doesn’t limit itself to Linux, is that the hardware and trackpad are a bit flaky. So much so that it took Dell seven firmware revisions over the course of a year to finally get most of them resolved. The most glaring issues are characters repeating when pressed, and the mouse cursor jumping unexexpectedly and causing all kinds of palm detection issues. Also, and this may just be my particular unit, the ‘Y’ and ‘6’ keys seem to be unresponsive. In fact, the ‘6’ key is such a problem for me that I actually need to press and hold it for a second before it registers the stroke. As a VIM user, this is a big issue for me as Shift+6 (i.e. ^) is an important character.

Last, wifi is a big problem when running just about any Linux distribution. The laptop shipped with a Broadcom chip that requires ‘non-free’ drivers under Linux. I couldn’t find a single distribution that automatically detected this hardware or shipped with the requisite driver in a way that it was available during installation. To me, a bit of a stretch to call this a Linux focused system when you can’t even get through the installation of a modern Linux distro without complications. In my case, I had to pull the cheapo USB wireless adapter from the back of my TV in order to have an internet connection during installations. After about a year of owning this system I finally went and bought an Intel 7265 card and replaced the Broadcom. If you’ve got a Broadcom based XPS 13, $30, and a screwdriver I suggest you do the same.

But, I digress. This isn’t intended to be a hardware review. The purpose of this entry is to document the steps I took to get Debian Jessie (8.3) installed and running acceptably on the Dell XPS 13 (9343). I only included the above to provide some context as to why the steps below aren’t simply:

  • Download ISO.
  • Install Debian.
  • Enjoy.

Why Debian?

Ugh. More context.

I’ve tried several distributions of on this laptop. I stuck with the OEM install of Ubuntu for about a week. The touchpad was herky jerky, the wifi card seemed unstable, and I personally came to dislike Unity. Even with my dislike of Unity, I figured simply upgrading to the most recent version of Ubuntu would go smoothly since it was at least the same distribution as the OEM install. I was wrong. With Ubuntu 15.10, the Broadcom card wasn’t even recognized. I had to use my TV’s USB adapter and once I got the appropriate driver installed I had to turn the wireless card on/off a few times before the module would load properly.

Eventually I thought, well, I use CentOS a lot at work, so maybe I should give Fedora a try? I installed the latest Fedora (23 at the time), and aside from the expected issues with the Broadcom wireless adapter it worked pretty well. The touchpad seemed more reliable and I really liked how minimal Gnome 3 felt when it was closer to the defaults.

Now, this is my “knock around” system. At work I’ve got a company issued Macbook Pro and running OS X is great in that environment. Sometimes I like to work on personal side projects or just do everyday computing tasks on my own machine, and for that I’ve got this little guy. Fedora was running happily on this system for about eight months. Then, I got the itch. You know it, that try something new itch I find to be so common amongst Linux users.

I wasn’t a big fan of how fast Fedora, Ubuntu and some of its derivatives like Mint move. I use CentOS at work, and so it wouldn’t have really felt that different. Debian felt like a natural choice. It moves a bit more slowly, has a reputation for stability, and is closer to minimal than something like Ubuntu.

Install the latest BIOS Revision

This is step zero. At the time of writing, I have dutifully installed all the way up to BIOS Revision A07 (I think the laptop shipped to me with A02). From what I can tell, A07 seems to have resolved all of the keyboard and touchpad issues that I encountered early on. That being said, due to other reasons the touchpad can still be kind of flaky until you configure the synaptics driver manually.

You should be able to find it by searching, but here’s a working link to the Dell page for the XPS 13 9343 BIOS Rev A07. You may want to go to the Dell Drivers and Download site and make sure this is still the latest.

The steps for installing the BIOS update are on the afore linked page; all you need is a FAT32 formatted USB stick.

Getting Debian

As you may know, the XPS 13 doesn’t have an optical drive and so really the only option was to use a USB stick (actually I needed two as you will see).

Debian makes it pretty easy to create a USB stick for installtion because their CD/DVD ISO images are built using the isohybrid format. So, the first step is to head over to debian.org and download the image appropriate for your architecture. In my case, I downloaded the DVD installation image from an FTP mirror site, but you’re free to use BitTorrent or whatever other method you are comfortable with.

The debian FAQ has all the information you need to create a USB stick or CD/DVD disc based on your operating system, but here are the steps I followed which should work on just about any current Linux distro:

NOTE: If you’re using the DVD image you want to be using an 8Gb USB stick.

NOTE 2: You should obviously backup your system before going further, proceed at your own risk!

# Make sure the USB drive is not plugged in.
$ ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 Feb 13 21:50 /dev/sda
brw-rw---- 1 root disk 8, 1 Feb 13 21:50 /dev/sda1
brw-rw---- 1 root disk 8, 2 Feb 13 21:50 /dev/sda2
brw-rw---- 1 root disk 8, 3 Feb 13 21:50 /dev/sda3

# Take note of the devices listed above, then plug in the USB stick.
$ ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 Feb 13 21:50 /dev/sda
brw-rw---- 1 root disk 8, 1 Feb 13 21:50 /dev/sda1
brw-rw---- 1 root disk 8, 2 Feb 13 21:50 /dev/sda2
brw-rw---- 1 root disk 8, 3 Feb 13 21:50 /dev/sda3
brw-rw---- 1 root disk 8, 3 Feb 13 21:52 /dev/sdb
brw-rw---- 1 root disk 8, 3 Feb 13 21:52 /dev/sdb1

# Whatever device wasn't there before is the USB stick.
# In this case it is /dev/sdb

# Make sure to unmount the device, but don't eject it!
$ sudo umount /dev/sdb

# Erase all contents of the USB stick.
$ sudo dd if=/dev/null of=/sdb bs=1k count=8192

# Now all you have to do is copy the ISO image to the USB stick.
$ sudo cp ~/Downloads/debian.iso /dev/sdb

# Go ahead and eject the device
$ sudo eject /dev/sdb

At this point you can safely remove the USB drive if you aren’t ready to proceed, or if you are using it on a different machine.

Get ‘non-free’ Firmware

I’ll save you the annoyance of trying to perform the installation at this point, and simply tell you to create a second USB stick containing the non-free firmware necessary to run Debian on some hardware. In my case, I need to have the firmware for the Intel 7265 card that I replaced my stock Broadcom with.

First, you need to go and download the firmware tarball:

The actual process of creating the firmware USB is similar to the above at first, so let’s assume we’ve already discovered the /dev/sdc is the device for the second USB stick and that we’ve already unmounted and erased it.

NOTE: I’m using a 2Gb USB stick for this, adjust commands as appropriate.

NOTE 2: Take a look at This stackoverflow answer.

# We need to create an MSDOS partition on the USB stick
$ sudo parted /dev/sdc mklabel msdos
$ sudo parted -a none /dev/sdc mkpart primary fat32 0 2048
$ mkfs.vfat -n "Firmware" /dev/sdc1

# Now we need to mount disk and copy the firmware over to it.
$ sudo mkdir -p /mnt/usb
$ sudo mount -t vfat /dev/sdc1 /mnt/firmware
$ cd /mnt/usb
$ mkdir firmware
$ tar zxf ~/Downloads/firmware.tar.gz

# Now you can unmount and eject as necessary
$ sudo umount /mnt/usb
$ sudo eject /dev/sdc

Installing Debian

Make sure that both USB sticks are plugged in to your XPS 13 and that you have the laptop charging, then reboot the system. Be ready and hit the F12 key a couple of times as soon as you see the Dell logo.

At the UEFI boot menu, select the USB stick that contains the Debian installation image and hit enter.

At this point, you should be presented with the Debian installation menu, and your fist choice is between the “Install” and “Graphical Install” options.

As you will find out later, Debian Jessie did not really do right by my touchpad. In fact, when I first attempted a “Graphical Install” the touchpad did not work. I got by with the keyboard until the package selection step, during which I could not figure out have to highlight and execute the “Continue” button.

To keep a long story short, my recommendation is to stick with the “Install” option on the XPS 13. If you’d like to try the “Graphical Install” go ahead. It’s entirely possible that there are variations in the exact touchpad hardware, and so you may get a more favorable result. However, if the “Graphical Install” fails you, reboot the system and go with “Install”.

I won’t bore you with all the screens of the install process, since it went pretty smoothly. The only important choice to be aware of if you’re following this guide is that I kept everything at the defaults during the package selection step. I.e. I chose the “Debian Desktop Environment” option selected. At first I was confused as to what would happen, but basically you wind up with a Gnome 3 install.

Upon Successful Install

After getting through the installation and rebooting into my new environment, I noticed that the touchpad was responding. However, only basic movement and left-click were working. I could not use two-finger scrolling or right-click.

The following sections detail a few things that I needed to do to get all my problems worked out, but should hopefully be in a more optimized order for you!

Disable the CD/DVD in sources.list

Oddly enough, Debian doesn’t make the assumption that you’ve got a network connection, and so by default it leaves the CD/DVD entry in the /etc/apt/sources.list file. In my experience I found that this caused major annoyances installing additional packages.

As you’ll find out next, sudo wasn’t installed by default, and so the following terminal commands will comment out the CD/DVD source.

user@localhost $ su -

# Always good to have a backup in case something goes wrong!
root@localhost $ cp /etc/apt/sources.list sources.list.bak

# This will edit the file in place
root@localhost $ sed -i 's/deb cdrom/# deb cdrom/' /etc/apt/sources.list

# Make sure the sources.list is correct
root@localhost $ apt-get update

Install sudo

I’m not sure why as I am new to Debian, but the sudo package was not installed for me by default.

user@localhost $ su -
root@localhost $ apt-get install sudo 

# Adding your user to the sudo group should suffice unless this is
# a multi-user system and you want to provide more granular permissions.
root@localhost $ usermod -a -G sudo user
root@localhost $ exit
user@localhost $ sudo echo "Test!"
Test!
user@localhost

Getting the touchpad working

I am still not convinced that my touchpad is 100% properly configured, but it certainly works better than when I first installed Debian. The long and short of it is that the touchpad device is not properly detected and therefore doesn’t get setup to use the synaptics driver correctly. In order to remedy this I had to drop a change to my X11 config.

$ sudo mkdir -p /etc/X11/xorg.conf.d
$ sudo touch /etc/X11/xorg.conf.d/50-synaptics.conf

Now, use your editor of choice to find the following in the /etc/X11/xorg.conf.d/50-synaptics.conf file:

Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
# This option is recommend on all Linux systems using evdev, but cannot be
# enabled by default. See the following link for details:
# http://who-t.blogspot.com/2010/11/how-to-ignore-configuration-errors.html
       MatchDevicePath "/dev/input/event*"
EndSection

Replace the lines above with:

Section "InputClass"
        Identifier "touchpad catchall"
        Driver "synaptics"
        MatchIsTouchpad "on"
		Option "ClickPad" "true"
		Option "EmulateMidButtonTime" "0"
		Option "SoftButtonAreas" "50% 0 82% 0 0 0 0 0"
		# Natural Scroll
		Option "VertScrollDelta" "-111"
		Option "HorzScrollDelta" "-111"
# This option is recommend on all Linux systems using evdev, but cannot be
# enabled by default. See the following link for details:
# http://who-t.blogspot.com/2010/11/how-to-ignore-configuration-errors.html
        MatchDevicePath "/dev/input/event*"
EndSection

You may need to log out and then back in, or even reboot your system, in order for this to take effect. After getting back to your desktop you should be able to click & drag, use both the left and right buttons, and use two-finger “natural” scrolling.

As I stated previously, I’m still not convinced I’m 100% done with my touchpad settings. However, I don’t use the mouse much as I’m an i3 window manager user.

Installing the Intel HD 5500 Graphics Driver

The recent generation of integrated Intel graphics chips is actually pretty impressive. However, as I came to find out, the Intel HD 5500 isn’t detected automatically by Debian Jessie 8.3.

You should checkout the stackoverflow question/answer for exact steps.

The steps in the answer worked perfectly for me, but be aware that in my case I had to do a full power-off (not just a reboot) in order to get the driver working properly.

After getting this sorted out, I noticed that scrolling was a lot smoother and that there were a lot fewer vsync issues.

Summary

At this point you should have a fully working XPS 13 (9343) running Debian Jessie (8.3). Your touch pad, wifi, and Intel graphics should all have the correct drivers, and you should notice that Debian running Gnome 3 is screaming fast.

I pulled from a lot of sources and did a lot of searching as I came across the issues identified above. My only goal here was to save you some time hunting down all this information, and to show that you can get a stable Linux system running on the XPS 13 without running a bleeding edge 4.x kernel. In fact, running the 3.16 kernel provided by Debian Jessie makes my system feel far more stable than I experienced with any of the more bleeding edge distros I tried.

Please let me know if I didn’t give proper credits to anyone!