I have an XPS 13 with Dell's own TB-16 dock. Despite the lack of official Linux support it works really well, as long as WiFi is turned off. This is okay since I have a wired connection at my desk, but if I try to boot with the dock connected it won't work since it crashes before I can log in and turn off the WiFi.

I suppose I could craft some script that detects the dock itself or maybe a specific USB device (like the keyboard) connected to it, but only if I connect the dock while the system is on. In that case I can just turn off WiFi manually anyway.

Is there some way to make sure that the WiFi is never activated in the first place whenever I boot with the dock connected? Alternatively, can it just always be turned off at every reboot? Having to turn it on manually is not so bad since my laptop is docked most of the time.

  • Have you tried a newer kernel? Oct 4, 2017 at 1:45
  • Not beyond 4.10, which is the one I'm getting from the standard Ubuntu repositories. I'm not having problems anymore, so I'm happy with it. Oct 5, 2017 at 7:24

1 Answer 1


I use the following script to handle whether wifi should be active based on an ethernet connection. You could likely make minor edits for your use case and connection names (e.g. "eth0"). You will need to chmod +x and permission as necessary ...

With NetworkManager, it sits in /etc/NetworkManager/dispatcher.d/


#!/usr/bin/env bash

if [ "$1" = "eth0" ] || [ "$1" = "eno1" ]; then
    case "$2" in
            logger "[Script] Ethernet connect detected. Turning Wifi radio OFF";
            nmcli radio wifi off
            logger "[Script] Ethernet disconnect detected. Turning Wifi radio ON";
            nmcli radio wifi on

Here is a reference to NetworkManager events ($2) that may be helpful: https://developer.gnome.org/NetworkManager/stable/NetworkManager.html

  • I've considered something like that, but it will still leave me with the boot problem. Jul 9, 2017 at 18:53
  • If your problem is pre-OS yet after POST, the only places to address such an issue is at the BIOS or bootloader and that will not be (seemlessly) variable once the OS loads as you might know. That is to say, you might be able to hack with a module .ko file not loading initially, but that's quite "ugly".
    – Mark
    Jul 9, 2017 at 20:10
  • --- Some laptops have a BIOS bound toggle [Fn] key to enable/disable the wifi card. Perhaps your XPS has that?
    – Mark
    Jul 9, 2017 at 20:16
  • Thanks for your suggestions! I do have the key, but to use it will still need to unplug the laptop and open the lid when i start it, which is what I'm trying to avoid. The problem is unpredictable, but it seems to happen at the login screen or right before that, so it's not a bootloader issue. Shouldn't there be some configuration option for controlling automatic connection to WiFi networks? Jul 10, 2017 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.