Skip to main content

Linux on XPS 15 9550/9560 with TB16 Dock [Update:3/29]

Finally got a laptop to replace my fat tower at work - Dell XPS 15 9560. I was allowed to choose which one I wanted and chose the XPS for its Linux support since Dell ships developer edition XPS's running Ubuntu so I figured Linux support would be better than other manufacturers. At first they got me the model with the 4K screen but my monitors are 2K and multi-dpi support in Linux is virtually non-existent and even hi-dpi support on its own is pretty terrible. So I got it exchanged for the model with the regular 1080p screen (which happened to also be the updated 9560 model), which works much better. I'm very glad to report that pretty much everything works, including the TB16 desktop dock, with just a bit of settings tweaking. This post is to help anybody considering getting this setup or looking for help getting things working. For now, I am running Kubuntu 16.04 with KDE Neon installed.

List of things I explicitly tested and work:
  • WiFi, Bluetooth
  • Thunderbolt charging from TB16 dock
  • Dual 2K monitors through dock
  • Audio, USB, Ethernet through dock
  • Dual boot and VM from raw Windows partition
  • Touchscreen (on the 4k model)
  • Keyboard backlight
  • Power button on dock acting as the regular power button
Limitations/things that don't work or don't work very well (that I've discovered so far):
  • Speaker out on the dock (in the back) doesn't seem to work, but the headphone jack on the front is fine.
  • KDE seems to forget my monitor layout on occasion. This is mildly annoying but I'm hoping this can be fixed soon in software. [update 3/29] It does not forget monitor layout anymore but most windows (Chrome, PhpStorm) don't remember their placement. Some applications (Sublime, KDE apps, Electron apps) consistently remember their preferred monitor so this seems like a matter of applications implementing window manager hooks correctly.
  • Occasionally hotplugging the dock will cause KDE/Plasma to freeze. Again, mildly annoying but hoping for a fix soon. [update 3/29] This rarely happens but the freeze is a complete system hang not just KDE/Plasma.
UPDATE 3/29: I've been using this setup for a couple months now and here's my experience so far:

  • Overall things still work well for the most part
  • Hotplugging the dock rarely results in a system hang (completely unresponsive). However, this has only happened a few times in the couple months and so it does not bother me that much, and I have not seen any pattern.
  • Booting with the dock plugged in results in some funky font rendering and/or DPI/scaling issues, so I always boot with the dock unplugged and just hotplug it after logging in.
  • Sometimes the Ethernet adapter in the dock will stop working (sometimes there will be failures related to SSL, sometimes my dnsmasq setup will stop resolving). There are bug reports for this issue (e.g. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1667750) but for now taking it down and bringing it up again fixes it for me without rebooting ($ sudo ifconfig enx204747f8f471 down && sleep 30 && sudo ifconfig enx204747f8f471 up - just replace "enx204747f8f471" with your interface name if it's different). So, mildly annoying but tolerable.


To help anybody in a similar situation, here is what I did to get everything working. 

First off, let's tweak some BIOS settings so the hardware plays well with Linux:
  • Change SATA to AHCI mode (System Configuration > SATA Operation) - otherwise Linux does not recognize the drive for some reason
  • Set Thunderbolt security level to No Security (System Configuration > USB Configuration) - otherwise only the monitors work through the dock
  • Turn off Secure Boot (Secure Boot > Secure Boot Enable) - otherwise nvidia and virtualbox drivers do not work as they are not signed by a trusted key
  • (personal preference) Change function keys to be F1-12 by default (POST Behavrior > Fn Lock Options, set to Enable/Secondary)
At this point, due to the change in SATA mode, Windows will refuse to boot, but just go into safe mode and it will fix itself after a reboot. After that, start Windows as normal and install necessary firmware updates (it will reboot for each one):
Once that's done, you can now install Ubuntu. I am installing Kubuntu 16.04 and throwing KDE Neon on top of there to get the latest and greatest (both in terms of looks and functionality and stability). Installation is fairly straightforward, the only problem I encountered was that the Kubuntu installer was unable to automatically partition the driver properly for dual-boot but it was fairly simple to use gparted to set up the root and swap partitions (I chipped off space at the end of the main Windows partition to make space - for me it was between partitions 3 and 4). 

After Kubuntu was installed, I installed KDE Neon to get the latest Plasma version as it bring significant multi-monitor and hotplug improvements to the desktop environment:
$ sudo apt-add-repository http://archive.neon.kde.org/user
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E6D4736255751E5D
$ sudo apt update
$ sudo apt full-upgrade
During the upgrade, there are some conflicts with existing packages, so I had to do $ sudo apt-get install -f and $ sudo apt full-upgrade a few times. The install -f will remove the conflicting packages and the full-upgrade will continue the upgrade. Do this a couple times if necessary.
Neon also renames the distribution name which will break later calls to add-apt-repository. There is a simple fix, however, just replace "neon" with "Ubuntu" (case-sensitive) in the /etc/lsb-release file.

Optionally, if you want, you can make Virtualbox boot the raw Windows partition as a virtual machine, so you can have both dual-boot and a VM without taking up double the disk space (the only caveat is that you have to be sure to unmount the Windows partition in Linux if you have it mounted). To do so, first add yourself to the disk group so you can access raw partition information by running $ sudo usermod -a -G disk $(whoami). Log out and log back in for changes to take effect. After that, run $ VBoxManage internalcommands createrawvmdk -filename RawDisk.vmdk -rawdisk /dev/nvme0n1 to create the VMDK that points to the raw disk. Then set up the VM in Virtualbox as you would with any existing VMDK. The only critical setting is to enable EFI in the VM's System settings. The settings I ended up with are:
  • 2 GB RAM
  • 1 CPU (PAE/NX enabled
  • 2D and 3D acceleration enabled with 256 MB VRAM
  • USB 3.0 controller (requires Virtualbox extension pack)
So after all that, everything is operational and I can dock the laptop with just one cable, dual-boot between Linux and Windows, and boot to the Windows partition from Virtualbox. If anyone has any particular functionality to test, let me know in the comments.

Comments

  1. I didn't know that Virtualbox is able to boot a raw Windows partition, seems cool! But how does Windows handle the difference between raw hardware and virtualized hardware? This solution just works or does it have some glitches and limitations?

    ReplyDelete
    Replies
    1. It actually works quite well! First time it booted it had to install drivers (and I installed Vitrualbox guest additions) and after that it asked me to verify my Microsoft account but since then it's been working perfectly fine. Somehow Virtualbox's EFI even knows to boot directly to Windows without me telling it to (so there is no chance of accidentally booting the mounted Linux partition and causing data corruption).

      Delete
    2. So you can actually use the Internet normally? I read that with OEM installations they don't work if booted in VBox, but since I get the impression that you actually use this, this information may be wrong? Am I correc that Windows never again asked you to verify windows?

      Delete
  2. Would the same trick in Windows allow you to use your Ubuntu install in VBox for Windows?

    ReplyDelete
    Replies
    1. I believe so, I know I saw a few guides for this when I was searching around myself.

      Delete
  3. Sounds very good to me, thanks for sharing! I've been hesitant to spend on the TB16 because TB15 was a total disaster, especially under Linux...

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. This comment has been removed by the author.

    ReplyDelete
  6. For your multi monitor are you using displayport or hdmi?

    thanks.

    ReplyDelete
    Replies
    1. I'm using two 2K monitors connecting through the DP and mini-DP ports on the dock. I've also tried the HDMI ports on both the dock and laptop itself and they all work. I've also tried a USB-C/Thunderbolt to dual-DP adapter and it works just fine.

      Delete
  7. have you tried switching to battery from AC while the laptop is powered on ? Do you experiencecomplete system freeze-up ?

    ReplyDelete
    Replies
    1. I regularly hotplug/unplug the dock while powered on and it works fine. I've had it freeze a couple times but it's pretty rare and I can't identify a pattern. I've once hotplugged the dock with the lid closed and the laptop suspended and that woke up the laptop but messed up my monitor settings so since then I've just made sure to have it awake when I dock it.

      Delete
  8. Thank you very much for sharing your experiences and tips.
    I have more or less the same setup, and everything works beautifully.
    I am especially grateful for the tip on using the Windows installation within Virtualbox. Work like a charm!
    I only had some trouble at first with windows overriding grub. But that is solved now too by disabling the Windows bootloader in the bios.
    This is the best machine/setup I have ever had,
    great work!

    ReplyDelete
  9. This was most useful, thanks!

    I created the raw vmdk and all is well apart from I tried to change some windows settings and received the following. It seems Win10 thinks I'm using the same product key on different HW. Did you not have this?

    "We can't active Windows on this device because the product key was already in use on another device..."

    ReplyDelete
  10. Here's something fun. I've got a TB16 with XPS 15 9550 and Ubuntu 17.04. We started using 802.1x and for some reason my SSL connections stopped working correctly. I got a bit scared when apt update also gave errors.
    I didn't have any problems without 1x, nor via Wifi.

    So I downloaded the InRelease via Wifi and via cable. This is the file I got via cable: http://blauwblaatje.nl/InRelease.1

    I connected my usb network dongle, connected with 1x and I have no problems.

    So somewhere the network driver barfs while copying the packets to a file, I think, since there are no TCP errors.

    (Clarification, SSL broke down because the certificate was garbage, apt update broke down because the InRelease had garbage, other files, like pictures, couldn't be handled because of the garbage)

    ReplyDelete
  11. Thanks for the tip on turning off thunderbolt security -- I couldn't get anything but displays working until changing that! Much obliged.

    ReplyDelete
  12. I still don't have sound working, and I haven't tested the ethernet connectivity. I didn't find an audio connection on the back, and the front headphone connection doesn't seem to work either. Hotplugging works fine, and everything else seems to be quite happy. I've only wedged it one time. The sound not coming through is kinda annoying. I see a USB-Audio thing in alsamixer, but I can't ever access it. I don't know if I'm supposed to, or if it's going to be some kind of transparent thing.

    I'm pretty sure I installed everything as specified, so I'm not sure what's different. I'm on Ubuntu mint 16.10, so I should be sufficiently up to date.

    ReplyDelete
    Replies
    1. Same here. I'd love to know how the author got audio working.

      Delete
    2. Maybe he uses alsa instead of pulseaudio. For example I can't select the TB16 in the gnome audio settings, but in audacity and the TB16 as output and it works.

      There is a patch for pulseaudio, but only in the next-branch. See here: https://github.com/pulseaudio/pulseaudio/commit/c8851db8b223019415ddde15262722160f53f0c4

      I applied the udev rule and add the profile and now it works perfectly in pulseaudio.

      Delete
    3. Do you get low volume from the dock? 100% from the dock is like 10% from the laptop jack. It also seems to lack "plug in detection"

      Delete
  13. 1) I can't manage to get either 3.55mm jack working on my dock.

    2) Can you use the internal display at the same time as three 1080p monitors?

    3) I crash everytime I switch from docked to undocked.

    4) When I try and boot windows in a raw partition performance is lousy until it gets to the login screen. Where's its relatively better. And then once you log in everything goes to hell and CPU usage pegs to 99% and the VM becomes unusable.

    ReplyDelete
    Replies
    1. 5) Ethernet drops far too much to be reliable. I'm just using an ethernet -> usb adapter for the time being.

      Delete
    2. 6) Volume/mute control is pretty lousy when switching between headphones and speaker.

      These are the aliases required to control my volume on my computer.

      ```
      bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% && pactl set-sink-volume 1 +5% && amixer -c 1 set Headphone unmute && amixer -c 1 set Master unmute && amixer -c 1 set Speaker unmute

      bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% && pactl set-sink-volume 1 +5%

      bindsym XF86AudioMute exec --no-startup-id amixer -c 1 set Headphone unmute && amixer -c 1 set Master toggle && amixer -c 1 set Speaker unmute

      ```


      You can see that I have to increase the volume for both Audio Device 0 & 1. This is because the device ID changes based on whether or not my computer boots with the 3.5mm jack populated or not. 😑 It also mutes my headphones at boot but not my master volume. So every time I boot my computer I have to unmute my headphones. But by default the mute key wouldn't work since it only controls master volume....... I just made it so volume up unmutes everything and increases volume in both channels by 5%. Since master volume still overrides Speaker volume for loudness.

      Delete
  14. My setup: Dell XPS 15 9560 + Linux Mint 18.1 + TB16 Dock + dual HDMI monitors (1 HDMI & 1 MINI-DP-to-HDMI) with laptop lid closed

    The only way I make this work is to turn off the laptop, close the lid, and plug in the dock. Once I plug in, it's automatically turned on. Two monitors are working, everything seems fine except: 1) occasionally I have to unplug/plug the keyboard & mouse to make them work; 2) the RJ45 on TB16 doesn't work, i have to use a thunderbolt-to-usb + a usb ethernet

    On the other hand, hot-plugging is not working at all in the following cases:
    1. Suspend, unplug, plug back in, revive - two black monitors
    2. Hibernate, unplug, plug back in, revive - two black monitors
    3. Turn on the laptop, plug in TB16, close lid - two black monitors

    ReplyDelete
  15. With the latest kernel (4.13) the Ethernet is working fine.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  16. My setup: Dell 9550 + Ubuntu 16.04 + TB16 + (VGA + HDMI) lid closed

    Running 4.8.0-58 kernel + Intel 7265 Wifi

    BIOS 1.4

    This seems to be rock solid for me. Button on dock starts and stops laptop, doesn't matter if lid is open or closed. Hotplug works, Gigabit ethernet solid. Only issue is no audio from 3.5mm jack, but I don't use it so have not investigated a fix.

    BTW the kernel bump will earn you 7+ hours battery life, so worth it!

    ReplyDelete
  17. Does the TB16 work with an external 4K monitor at 60Hz or does it do 30Hz only?

    ReplyDelete
  18. Got so fed up with ethernet constantly dropping even with up to date kernel, firmware etc I purchased the following and ethernet has been solid since!

    https://www.amazon.com/gp/product/B00NOP70EC/ref=oh_aui_search_detailpage?ie=UTF8&psc=1

    ReplyDelete
  19. I would be super interested in a video tour of your setup (or some photos). Either way, nice job and thank you for documenting the steps + process!

    ReplyDelete

Post a Comment

Popular posts from this blog

Broadcom Bluetooth Driver: Installer or Virus??

My primary computer at the moment is an HP dv6 laptop (with Broadcom 2070 Bluetooth chip). Upon getting my laptop, I immediately wiped the hard drive and slapped on a fresh copy of Windows 7. Installed the drivers from HP, and everything was rolling along nicely... Fast-forward 4 months... Now I'm having some issues with Bluetooth communication between my phone (Android) and my laptop. So I reinstall the Bluetooth driver... The installation took a long  time, but eventually errored-out, and quit. Of course, I had left the computer unattended during this, and came back to an almost-empty hard drive (!!!!). Restored for backup, some minor data loss, no problem... I thought I had snagged a virus in the download (even though it was direct from HP's site). Redownload, scan with multiple scanners, run it ....... SAME RESULT!!! Giving up on the official installer, I just took the drivers that the installer unpacked, and manually installed them... That didn't solve my original pr

JComboBox with Disabled Items

Recently, I was working on a project in Java and needed to have a combo box, but with certain items in the list disabled (e.g. gray and non-selectable). At first, I simply set a custom renderer for the combo box which checked if the item was disabled. That, however, did not prevent the items from being selected. Thus, I set about to find a viable solution. There are plenty of solutions out there, but none seemed to work exactly the way I wanted. In the end, I ended up subclassing JComboBox to provide the functionality of disabling individual items. Here is my result, in under 100 lines: import java.awt.Component; import java.util.ArrayList; import javax.swing.JComboBox; import javax.swing.JList; import javax.swing.plaf.basic.BasicComboBoxRenderer; public class PartialDisableComboBox extends JComboBox { private static final long serialVersionUID = -1690671707274328126L; private ArrayList<boolean> itemsState = new ArrayList<boolean>(); public PartialDisableComboBox