Setting Up My XPS 13

I purchased an XPS 13 Developer Edition to do my coding. This article details how I set it up and configured it.

Purchase Decision

I purchased an XPS 13 Developer Edition because I wanted something more compact on which I could do my development work. I also wanted to say no to Windows 10.

There were so many issues with the ordering process, from Dell not accepting BitCoin in the UK to them not accepting my BitCoin debit card because it is denominated in "Gibraltar Pounds".

Not only did I have to contend with the Web site constantly becoming non-responsive, but I also had to find the secret page on Paypal's Web site that allows you to disable automatic (forced) currency conversion—Sterling is Sterling.

With so many issues actually making the order, I wondered if the universe was telling me not to make the purchase. I even considered buying from the Microsoft store, but not only would that be sending the wrong signal to Dell and Microsoft but the machine specs I wanted weren't available from there.

In the end, I went ahead with the order, despite the potential problems with USB-C/Thunderbolt 3.

The delivery date changed between checkout and order confirmation, but I did eventually received a rather compact (and light) parcel. It had an even smaller black box inside, the charging brick, and the IEC C5 to UK 3-pin power cable. The power cable is still in the box as I bought a C5 to C14 power cable to plug the power brick straight into my UPS.

Nothing special to write here about the insides of the black box: a single piece of plastic covering the XPS 13, with an XPS 13 Quick Start Guide pamphlet and a Safety and Regulatory Information leaflet underneath.

The Quick Start Guide

Ignoring the references to Windows, these are the steps of the Quick Start Guide:

  1. Connect the power adapter and press the power button [picture showing how to plug the power cable into the brick, the cable from the brick into the ultrabook, and a hand with the index finger pointing at the power button].
  2. Finish operating system setup
    1. Ubuntu: Follow the instructions on screen to finish setup.

Plug it in, turn it on, follow the instructions? The most useful thing on that page was the image showing me where I needed to plug the power into and where the power button was.

Anyway, the actual steps were:

  1. Give XPS 13 mains power.
  2. Boot XPS 13.
  3. Go through what's left to be configured, and when prompted create a recovery USB disk.
  4. Configure Wi-Fi (WPA2-Personal).

Configuring Updates and Updating

While all of this can be done through a GUI, I am going to be mainly using terminal commands and file editing where it is simpler. The reason for this is because GUIs might change between OS/app versions but the filesystem and commands change much less frequency.

Some files and commands are going to be different here to how I previously might have done things, however, with systemd having replaced upstart and SysVinit. Another command change you might notice is my use of apt, because for end users apt is now recommended now over apt-get.

APT is a vast project, whose original plans included a graphical interface. It is based on a library which contains the core application, and apt-get is the first front end — command-line based — which was developed within the project. apt is a second command-line based front end provided by APT which overcomes some design mistakes of apt-get.

Debian. aptitude, apt-get, and apt Commands. In The Debian Administrator's Manual (§6.2)

Open up gnome-terminal.

sudo nano /etc/apt/sources.list

Enter CTRL+W and then CTRL+R. Search for //us. and replace with //gb. (since I'm in the UK). Hit 'a' to replace all instances. Save (CTRL+O) and then exit (CTRL+X).

Check for and install updates, reboot.

sudo apt update && sudo apt dist-upgrade.
sudo reboot

Open up gnome-terminal, check for and install updates, remove old packages, reboot.

sudo apt update && sudo apt dist-upgrade && sudo apt autoremove && sudo apt autoclean

Refining BIOS/EFI Settings

With a new machine/motherboard it is usually a good idea to see what BIOS/EFI options there are as there might be some changes that can optimise things. First though, how do I actually get in there to make changes?

Open up gnome-terminal, and add a 5 second window during the boot process (at the Dell logo) where keys can be pressed such as F12 (brings up the boot options menu).

sudo efibootmgr
sudo efibootmgr -t 5

Output should include:

Timeout: 5 seconds

Reboot and hit F12 at the Dell logo.

Choose the menu option 'BIOS Setup'.

There wasn't much I wanted to change here.

In Power Management -> Primary Battery Charge Configurator, choose the charging profile that best suits your expected typical use. In my case, that is "Primary AC Use".

Under POST Behaviour -> Fn Lock Options, select the radio button 'Lock Mode Disable/Standard'. I use Alt+F2 a lot in Linux, so I don't want to have to toggle Fn+Escape after every boot.

Click Apply, and then click Exit.

efibootmgr has a lot of options, but Dell Diagnostics doesn't seem to be on the list of boot options from what I can see (I'm not sure if running sudo update-grub will add to the Grub2 boot menu a boot menu option that calls fwsetup). Adjusting the timeout for the moment seems to be the simplest method.

Testing the Hardware

Dell provide diagnostic utilities on their laptops and as with my Alienware m17x R3 I decided to run them as soon as I could to check all the hardware was detected as working properly, including a full check of the RAM—doubly important when it is non-replaceable and soldered to the motherboard.

At the Dell logo, hit F12 again.

Choose the menu option 'Diagnostics'.

At the prompts answer the questions as y (Yes) if what you're being asked was true.

After the quick testing is done, answer y to doing a thorough memory test.

Hopefully all of the tests come back fine. If so, click Exit. If not, make a note of any issues and contact Dell.

After booting, shut down the device. Changes to POST Behaviour won't be seen until the device next POSTs.

Creating More Backup Media

A USB flash drive isn't what I'd consider a suitable recovery media. Firstly I only have one of them because until recently I have never had a need for one; secondly they are very easy to accidentally overwrite (or deliberately, as I will be doing shortly). I want an ISO file.

Turn the device on again and let it boot.

Login to Ubuntu, and then hit Alt+F2. Type in Dell and click dell-recovery.

Click 'Build OS Media', and then click 'No media, create image'. Two ISO files will be created in ~/Downloads/. I created an md5sum of both ISOs, and then copied the 4 files to my USB drive. I then copied them from the USB drive to my ISOs folder on my laptop and home server and then checked the hashes matched.

Making a note of the partition table is usually a good idea, just in case.

Open gnome-terminal

sudo gdisk /dev/nvme0n1

I have 4 partitions:

Partition 1 starts at sector 2048 and ends at sector 1026047, and is an EFI system partition (the boot partition) - Code EF00 (FAT32 EFI).
Partition 2 starts at sector 1026048 and ends at sector 7317503, and is a Basic Data Partition (the recovery partition) - Code 0700 (FAT32).
Partition 3 starts at sector 7317504 and ends at sector 933734399, and is the ext4 partition (Code 8300) for /.
Partition 4 starts at sector 933734400 and ends at sector 1000214527, and is a linx-swap(v1) partition (Code 8200).

If I'm going to wipe this machine, I'd better put that ISO somewhere safe just in case I need it later.

I might as well create a backup of APT's repositories just in case I need them later. Insert an SD card (or another external media) and mount it.

sudo cp -vr /etc/apt /media/thejc/1274-9715/

(replace thejc with your username and 1274-9715 with the name of the external media).

Unmount the external media.

Clean Install With Encryption

If the NVME SSD that came with this XPS 13 supported TCG/Opal 2.0 I probably would have gone down the full disk encryption route at this point. As it doesn't, I went with a LVM on LUKS setup instead (without an encrypted /boot).

An advantage of not using full disk encryption is that if you power down a self-encrypted disk (e.g. suspend to RAM) then you can't resume as the SED will no longer be unlocked.

A disadvantage to an unencrypted /boot is that someone with physical access to the powered down machine can replace your kernel, although that could be mitigated by moving /boot completely off the device (e.g. to an SD card and/or a USB drive).

Unfortunately, the Ubuntu installer still doesn't make LVM on LUKS possible, as I discovered below. Fortunately, this issue means I have finally documented chroot'ing into a broken system. For the first time ever I am also going to be sticking with UEFI and secure boot.

Download Ubuntu ISO and Create Bootable Flash Drive

Preferably on another machine, download the latest Ubuntu 16.04 LTS Desktop 64-bit torrent. I'm using

Insert a USB drive in the computer the ISO is downloaded to.

"Burn" the downloaded ISO to a USB disk, after unmounting any partitions on it.

In my case, the inserted USB drive is /dev/sdd.

sudo umount /dev/sdd?*
sudo dd if=/media/veracrypt1/ISOs/Ubuntu\ Desktop/ubuntu-16.04-desktop-amd64.iso of=/dev/sdd bs=4M
sudo sync

Try mounting the disk in a file manager. If that looks fine, dismount it.

At this point (or maybe before burning to USB), it is probably worth checking the torrent's infohash to make sure Ubuntu's site hasn't been tampered with.

Using your torrent client, check the details of the torrent. The hash for the torrent I downloaded is 4344503b7e797ebf31582327a5baae35b11bda01.

Searching Google for '4344503b7e797ebf31582327a5baae35b11bda01' took me to and a search of that page not only lists it, but says that 61.97 TiB of that torrent has been transferred.

While I could search for a third party source to verify the hash, it is unlikely someone would have tampered with both and, so I have the right ISO.

sudo sync
sudo eject /dev/sdd

Remove the drive, insert it in the Dell.

Clean Install Ubuntu Xenial

Restart the XPS 13, hit F12 at the Dell logo, select the UEFI USB device. If avoiding UEFI, however, you'd want the USB device that doesn't mention UEFI.

On the GRUB menu, choose 'Check disc for defects'. It should eventually say "Check finished: no errors found". If errors were found, reburn the ISO to the USB drive. Otherwise, press any key to reboot.

Hit F12 at the Dell logo, select the UEFI USB device.

Select 'Try Ubuntu without installing' in the GRUB menu.

Open System Settings -> Displays. Adjust 'Scale for menu and title bars' to adjust the size of the text.

Connect to WPA2-Personal Wi-Fi.

Click the EN symbol in the tray and then in Text Entry Settings add UK keyboard layout. After closing the window, click the EN symbol again and choose English (UK). This keyboard layout will be used when setting your LUKS passphrase.

Open gnome-terminal.

Edit /etc/apt/sources.list so each line ends 'main restricted universe'

sudo apt update

Click the Install Ubuntu 16.04 LTS icon.

Click update the installer if available (it would be a link next to the release notes links). Then select English, click Continue.

Select 'Download updates while installing Ubuntu', 'Install third-party software for graphics and Wi-Fi hardware, Flash, MP3, and other media', 'Turn off Secure Boot', and enter a password twice that you will be asked for on the next reboot.

If when you proceed the Wi-Fi driver is sucky, it might disable the checking for updates while installing things—it did for me. It might reconnect during the installation to download packages, however.


Select 'Something else' and click Continue.

Select the fat32 recovery partition /dev/nvme0n1p2, and then click the minus button on the left under the table. Do the same for the ext4 'Ubuntu 14.04.4 LTS (14.04) partition, and the swap partition.

Select the 511,584 MB of free space, and click the plus button. Create a 1,582 MB ext2 /boot partition.

Click the 510,002 MB of free space and click the plus button. Create a primary partition that will be used as 'physical volume for encryption.

Enter a strong security key and confirm it. It will be needed every time you boot. Make sure your current keyboard input language is the language you'll be choosing during install before entering your security key/passphrase.

Also, select 'Overwrite empty disk space'. Click OK.

Click revert.

Select /dev/mapper/nvm0n1p2_crypt and click the New Partition Table button. Click continue.

Based on my own usage on multiple Debian/Ubuntu systems, I am going to be going with partition sizes suitable for me and partitions for multiple mount points.

As I use /opt for sources and compiling software, rather than /usr/local/src, my /usr is only 15 gigs. As I am using LVM and ext4, it should be possible to resize the partitions at a later date.

I am leaving 60 GB available for extra over-provisioning, extending other partitions, or other uses (such as for a KVM or two).

  • Click the 510,000 MB of free space, and click the plus symbol. Create a 5,000 MB /var partition.
  • Click the 505,000 MB of free space, and click the plus symbol. Create a 1,000 MB ext4 /root partition.
  • Click the 504,000 MB of free space, and click the plus symbol. Create a 30,000 MB swap partition.
  • Click the 474,000 MB of free space, and click the plus symbol. Create a 15,000 MB ext4 /usr partition.
  • Click the 459,000 MB of free space, and click the plus symbol. Create a 30,000 MB ext4 /opt partition.
  • Click the 429,000 MB of free space, and click the plus symbol. Create a 19,000 MB ext4 / partition.
  • Click the 410,000 MB of free space, and click the plus symbol. Create a 350,000 MB ext4 /home partition (leaving 60,000 MB free space).

Make sure the bootloader will be installed on /dev/nvme, then click Install Now.

If the installer crashes, close everything except gnome-terminal.

Manual Partitioning

ls -al /dev/mapper/

You should see your LVM/LUKS partition. In my case, it is /dev/mapper/nvme0n1p3_crypt

sudo pvcreate /dev/mapper/nvme0n1p3_crypt

If you see a warning that an ext4 signature is detected, say 'y' to wiping it.

With the physical volume created, create a volume group:

sudo vgcreate NVME /dev/mapper/nvme0n1p3_crypt

Now we can create the partitions. Since media uses base 10 rather than base 2, I am going to use bc and some simple maths to create some simple decimal gigabyte partitions with me only needing to change the number of gigabytes and the name of the volume between each command. For reference, a binary gigabyte is two to the power of 30.

sudo apt install bc
sudo lvcreate -L $(echo "5 * 10^9" | bc)B -n Var NVME
sudo lvcreate -L $(echo "1 * 10^9" | bc)B -n RootHome NVME
sudo lvcreate -L $(echo "30 * 10^9" | bc)B -n Swap NVME
sudo lvcreate -L $(echo "15 * 10^9" | bc)B -n Usr NVME
sudo lvcreate -L $(echo "30 * 10^9" | bc)B -n Opt NVME
sudo lvcreate -L $(echo "19 * 10^9" | bc)B -n Root NVME
sudo lvcreate -L $(echo "350 * 10^9" | bc)B -n Home NVME

Start the installer again and go through the steps until you get to the partitioning screen.

At the partitioning screen, click each Linux device-mapper (linear) partition, and click the Change button. Set it to ext4 (or swap for NVME-Swap), check the format box, and assign the mount point.

Likewise, select the ext2 partition, Change, ext2, format it, mount point /boot.

Continuing With Installation

Click Install Now. Check you're OK with what's been formatted, then click Continue.

Set timezone to London, Continue.

Set keyboard layout to UK if it isn't already, Continue. This should be the same keyboard layout used when you set your LUKS passphrase/security key.

After installation, click Restart Now.

Change secure boot state. Enter each character from the password you set pressing enter after each character asked for. Then select Yes to disable secure boot. Then click OK.

Chrooting Into Broken System

Ubuntu shouldn't boot as the bootloader doesn't currently know how. It is time to chroot into the broken system.

Reboot to the USB drive, and select the try without installing option.

Connect to Wi-Fi and adjust screen text size. Add UK keyboard layout and select it. Then open gnome-terminal.

cd /mnt
sudo mkdir root
sudo cryptsetup luksOpen /dev/nvme0n1p3 nvme0n1p3_crypt
sudo mount /dev/mapper/NVME-Root root
sudo mount /dev/nvme0n1p2 root/boot
sudo mount /dev/nvme0n1p1 root/boot/efi
cd root
sudo mount /dev/mapper/NVME-Home home
sudo mount /dev/mapper/NVME-Opt opt
sudo mount /dev/mapper/NVME-RootHome root
sudo mount /dev/mapper/NVME-Usr usr
sudo mount /dev/mapper/NVME-Var var
sudo mount -t proc /proc proc
sudo mount -t sysfs /sys sys
sudo mount -o bind /dev dev
sudo mount -t devpts /dev/pts dev/pts
sudo cp /etc/resolv.conf etc/resolv.conf
cd ..
sudo chroot root
apt update
apt dist-upgrade
cryptsetup luksUUID /dev/nvme0n1p3

Copy the output

nano /etc/crypttab
nvme0n1p3_crypt UUID=long-uuid-from-last-command none luks

Save and close.

nano /etc/initramfs-tools/modules

Add the following lines to the file:


Save and close nano.

update-initramfs -u
cd root
sudo umount dev/pts dev sys proc
sudo umount var usr root opt home
cd ..
sudo umount root/boot/efi root/boot root
sudo vgchange -an nvme0n1p3_crypt
sudo cryptsetup luksClose nvme0n1p3_crypt


Fixing Volume Group Name

Oops. I really didn't want to call my LUKS drive nvme0n1p3_crypt. NVME sounds so much better (plus fstab thinks the partitions are /dev/mapper/NVME-VolumeName).

It is possible to rename a volume group, but I won't go into that here. Basically you'd use vgrename and then modify /etc/crypttab and /etc/fstab.

Boot back to the USB Drive and open gnome-terminal.

cd /mnt
sudo mkdir root
sudo cryptsetup luksOpen /dev/nvme0n1p3 NVME
sudo mount /dev/mapper/NVME-Root root
sudo mount /dev/nvme0n1p2 root/boot
sudo mount /dev/nvme0n1p1 root/boot/efi
cd root
sudo mount /dev/mapper/NVME-Home home
sudo mount /dev/mapper/NVME-Opt opt
sudo mount /dev/mapper/NVME-RootHome root
sudo mount /dev/mapper/NVME-Usr usr
sudo mount /dev/mapper/NVME-Var var
sudo mount -t proc /proc proc
sudo mount -t sysfs /sys sys
sudo mount -o bind /dev dev
sudo mount -t devpts /dev/pts dev/pts
sudo cp /etc/resolv.conf etc/resolv.conf
cd ..
sudo chroot root
nano /etc/crypttab

Change nvme0n1p3_crypt to NVME:

NVME UUID=long-uuid-from-last-command none luks

Save and close.

update-initramfs -u
cd root
sudo umount dev/pts dev sys proc var usr root opt home
cd ..
sudo umount root/boot/efi root/boot root
sudo vgchange -an NVME
sudo cryptsetup luksClose NVME


Post Installation

At the Grub prompt choose Ubuntu.

When prompted "Please unlock disk NVME", enter the LUKS passphrase setup earlier in the Ubuntu installer.

Open gnome-terminal.

sudo nano /etc/default/grub
sudo update-grub
sudo mokutil --enable-verification

Enter a password that you'll be asked to enter some characters from on the next boot to re-enable Secure Boot.

sudo reboot

Press any key. Choose 'Change Secure Boot state'. Set Enable Secure Boot to Yes. OK.

Now that system setup can be accessed from the Grub menu, we can reduce the time the Dell logo is displayed to 1 second.

Boot back into Ubuntu, and open gnome-terminal.

sudo efibootmgr -t 1

Reboot and this time the Dell logo should be on the screen 4 seconds shorter.

Enter system setup, Power Management -> Block Sleep, make sure it is unchecked, Apply/Exit.

Boot back into Ubuntu.

Add Source, Universe, and Multiverse Repositories

Click Search your computer (Ubuntu icon) and search for Software & Updates and open it.

On the Ubuntu Software tab, check 'Source code'. On the Other Software tab, check 'Canonical Partners' and 'Canonical Partners (Source Code)'.

Click Close, and then on the dialog, click Reload.

Diagnosing Issues

As with any fresh install of an operating system, there are usually a few niggling issues that need resolving.

Suspend to Disk

Let's try sleeping.

First, open Firefox and visit a Web page.

Click the top right tray icon, and choose suspend.

Press the bower button after everything has turned, and login.

Check that everything is still working. In my case, Wi-Fi broke after resuming.

Open System Settings. Select Power. Change the settings if suspend didn't work properly (I changed 'When the lid is closed' to 'Do nothing').

While it is possible there is a fix, that is something I'll have to come back to later.


Firefox has trouble with touchscreen gestures (e.g. scrolling Web pages). Google Chrome doesn't and (unlike Chromium) has the Widevine DRM plugin.

Visit and download Chrome (.deb). Open it with the default application, and click the Install button.

I also want Chromium as it is currently my main browser (i.e. for most Web sites).

sudo apt install chromium-browser

Unity HUD

If I want to type in a Web address in Chrome/Chromium, ALT+D is a lot more ergonomic than CTRL+L for someone that uses the touchpad with their right hand. Having Unity's HUD pop-up every time I press the left alt button, however, is annoying.

As there is no simple way of disabling it, I have set it to a key combination I am very unlikely to ever press (and no program is ever likely to use).

Open System Settings -> Keyboard.

On the Shortcuts tab, select Launchers and scroll down to 'Key to show the HUD'. Click it, and then set it to a new key (combination) by pressing the key(s) you want to set it to. For me, that was Left Shift + Left CTRL + Left Super (Windows Key) + Left Alt + Right AltGr.

Only a crazy programmer would assign a keyboard shortcut that is awkward and requires pressing 5 keys using two hands. With this key combination I am unlikely to ever see the HUD again.


Wireless is being a bit bothersome, and the only way I can use the Internet after a while is to disconnect and reconnect to the Wi-Fi.

sudo nano /etc/default/crda

In order to comply with radio spectrum regulations, make sure you use the two letter ISO 3166-1 alpha-2 code for the country you are in.

sudo nano /etc/modprobe.d/cfg80211.conf
options cfg80211 ieee80211_regdom=GB
sudo reboot

sudo iw reg get should, after reboot, say "country GB". Likewise, dmesg | grep cfg80211 should say "Regulatory domain changed to country: GB". Unfortunately, it seems there is a race condition and this sometimes doesn't happen.

sudo iwconfig

My WLAN device is named wlp58so.

sudo iwconfig wlp58so power off

If that seems to stabilise Wi-Fi, make the change permanent across reboots.

sudo nano /etc/pm/config.d/blacklist

This, unfortunately, has no effect.

Let's also make network-manager restart itself after coming out of suspend:

sudo nano /etc/systemd/system/stop-wifi-on-sleep.service
Description=Remove iwlmvm module on suspend, add module on resume

ExecStart=-/sbin/modprobe -r iwlmvm
ExecStop=-/sbin/modprobe iwlmvm

sudo systemctl daemon-reload
sudo systemctl enable stop-wifi-on-sleep.service

Try suspending the machine, and then pressing the power button.

If Wi-Fi now works after resuming, use System Settings -> Power to configure power saving options.

For some reason blacklisting wireless power management doesn't work for me. Thinking about the best way to implement a workaround, it would be disabling Wi-Fi power management and dropping the transmit power after connecting to Wi-Fi.

sudo nano /etc/network/if-up.d/wifi-power

if [ "$IFACE" = "wlp58s0" ]; then
        iwconfig "$IFACE" power off
        iwconfig "$IFACE" txpower 20
sudo chmod +x /etc/network/if-up.d/wifi-power

And to ensure it is only in effect when connected to Wi-Fi (e.g. to save some power when travelling):

sudo nano /etc/network/if-post-down.d/wifi-power

if [ "$IFACE" = "wlp58s0" ]; then
        iwconfig "$IFACE" power on
sudo chmod +x /etc/network/if-post-down.d/wifi-power

That just leaves a couple of issues: removing the wireless module when NetworkManager/networking stops and loading the module after NetworkManager/networking starts, and not loading the module during boot until NetworkManager has started.

sudo nano /etc/systemd/system/load_wifi_module_after_network.service
Description=Load iwlmvm module after NetworkManager

ExecStart=-/sbin/modprobe iwlmvm
ExecStop=-/sbin/modprobe -r iwlmvm

sudo systemctl daemon-reload
sudo systemctl enable load_wifi_module_after_network.service
sudo nano /etc/modprobe.d/blacklist-wifi-on-boot.conf
blacklist iwlwifi
sudo update-initramfs -u

This is a really clunky workaround, and regulatory domain goes back to 00 if Wi-Fi is disabled or Wi-Fi is disconnected because I can't think of a way to unload/load the module when changing networks without a potential infinite loop.

Until NetworkManager supports setting regulatory domain (and power management and txpower in a way that works) this will have to do for the time being.

GRUB and Terminal (TTY) Font Size

On a "4K" screen that only has a 13 inch diagonal, the default GRUB and TTY fonts are tiny.

The default fonts in Ubuntu for TTY terminals is Terminus, and the default for GRUB is GNU Unifont.

Changing the TTY font is easy:

sudo dpkg-reconfigure console-setup
  • Encoding to use on the console: UTF-8
  • Character set to support: Guess optimal character set
  • Font for the console: Terminus
  • Font size: 16x32 (framebuffer only)

Then just switch to a TTY (CTRL+ALT+F1), login, and type setupcon. Repeat the process if you want to see which PSF (PC Screen Font) and font size you prefer (although the options are rather limited).

As for the GRUB font, to change the size you need to create a new font:

sudo grub-mkfont --output=/boot/grub/unicode42px.pf2 --size=42 /usr/share/fonts/truetype/unifont/unifont.ttf
sudo nano /etc/default/grub
sudo grub-mkconfig -o /boot/grub/grub.cfg

You'll need to reboot to test if the font is the right size, and if you mess up you might have to boot to recovery mode to fix the issue or revert the change and call grub-mkconfig again.

I previously used a 36 pixel font for GRUB on this machine, but I realised whilst writing this that I prefer the 42 pixel size more.

One thing not changed is plymouth's font size. That means the LUKS password prompt is still in small text, because the 2x scaling ubuntu-logo plymouth theme doesn't work if a password is required. I might revisit this at another time.

Installing Software and Tools

While the default desktop installation of Ubuntu Xenial comes with a lot of widely used programs, such as LibreOffice, there are tens of thousands of optional/extra packages available in the Ubuntu repositories plus a lot more programs available as .deb files or source code you compile yourself.

In this section I am going to install what I currently consider essential for my daily usage.

Electrum Bitcoin Wallet

I want my Electrum wallet to be accessible.

sudo apt install python-qt4 python-pip
sudo -H pip install --upgrade pip
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 sudo -H pip install -U
sudo -H pip install

If some errors occur during a future update, it is possibly because some development dependencies are missing. In my case I had trouble updating pybluez (libbluetooth-dev wasn't installed), gammu (libgammu-dev wasn't installed), and libvirt-python (libvirt-dev wasn't installed).

sudo nano /usr/share/applications/electrum.desktop

Change Categories=Network; to Categories=Finance;

Logout, and log back in.

Press the Windows/Super key, and run electrum, then restore the wallet.

SSH Private Key

The next thing I want to do is generate an SSH key so I can access my laptop, home server, and VPSs.

In gnome-terminal:

mkdir ~/.ssh
cd ~/.ssh
ssh-keygen -t ecdsa -b 384

Copy the .pub file to the SD card, then insert the SD card in my laptop. Open the .pub file and copy the contents to ~/.ssh/authorized_keys on my laptop and servers.

Geany Text Editor

Now, to add the graphical text editor I currently use.

sudo apt install geany geany-plugins

Because I have lost work in the past despite enabling auto-save, I now make sure being in that situation is almost impossible. It does, however, involve manually going through and cleaning up /var/tmp/thejc-geany/ every so often.

Open Geany, and then in Tools -> Plugin Manager enable the Save Actions and Spell Check plugins.

In preferences, check 'Enable save when losing focus', 'Enable', and 'Save all open files' for Save Actions under Auto Save. Enable Instant Save, and enable 'Backup Copy' saving to /var/tmp/thejc-geany (create the directory when using the directory picker).

For Spell Check, check 'Check spelling while typing' and 'Check spelling when opening a document'.

Click OK and then quit Geany. Reopen Geany and the plugins should be working.


My m17x R3 has a lot more disk space than my XPS 13, and I want to (for the time being) avoid having my working files duplicated everywhere. I am therefore going to use SSHFS mounts.

cd /mnt
sudo -v
sudo mkdir acme-challenge Alienware-JC
sudo chmod 777 acme-challenge Alienware-JC
sudo apt install sshfs
sudo nano /etc/fuse.conf

uncomment user_allow_other

mkdir -p Alienware-JC/home/thejc/
mkdir -p Alienware-JC/veracrypt1/Downloads Alienware-JC/veracrypt1/Pictures
sudo chmod -R 777 Alienware-JC
sudo -k
sshfs -o idmap=user -o allow_root -o IdentityFile=~/.ssh/thejc.XPS-13-9350-JC.key -o reconnect -o follow_symlinks thejc@ /mnt/Alienware-JC/home/thejc/
sshfs -o idmap=user -o allow_root -o IdentityFile=~/.ssh/thejc.XPS-13-9350-JC.key -o reconnect -o follow_symlinks  thejc@ /mnt/Alienware-JC/veracrypt1/Downloads
sshfs -o idmap=user -o allow_root -o IdentityFile=~/.ssh/thejc.XPS-13-9350-JC.key -o reconnect -o follow_symlinks  thejc@ /mnt/Alienware-JC/veracrypt1/Pictures

Open up Google Chrome's settings, and search for 'down'. Change the Download location to /mnt/Alienware-JC/veracrypt1/Downloads and check 'Ask where to save each file before downloading'.

Visit in Chrome, login, and in Camera Uploads select the most recent photos (today's) as a ZIP file.

After Mega has created the ZIP file, save it in the new default location (on my Alienware).

This might be a bit slow because of current network throughput due to throttling on this SSID's VLAN. As I cannot find my RADIUS CA configuration and files, I'm going to need to set that up again so I can use my WPA2-Enterprise EAP-TLS SSID which doesn't have any throttling.

Once downloaded, cut the ZIP from Downloads and paste it into the relevant folder in Pictures. Then start working on things.


Download and install GIMP.

sudo apt install gimp

Open, and then exit, GIMP.

Copy my GIMP settings and plugins from my laptop:

cp /mnt/Alienware-JC/home/thejc/.gimp-2.8/plug-ins/ ~/.gimp-2.8/plug-ins/
cp /mnt/Alienware-JC/home/thejc/.gimp-2.8/tool-presets/* ~/.gimp-2.8/tool-presets/

Open GIMP again. And work on the images just downloaded.

Once edited and exported, update my Twitter profile header and my strawberry plant gallery.

Git and GitKraken

sudo apt-get install git

Next, I need a GUI git program as there are some things (such as seeing where branches are) that I find easier to see graphically. At the moment, I am using GitKraken on my laptop.

sudo dpkg -i /mnt/Alienware-JC/veracrypt1/Downloads/v1.4.1.deb

OK. After configuration, I can see the home-server-backups branch is behind my other branches.

In an SSH session to my home server in the repository for

git checkout home-server-backups
git stash
git rebase develop
git stash pop


I use jitsi for XMPP and SIP.

sudo apt install jitsi

Add my accounts to jitsi.


I use modem-manager-gui to send/receive SMS text messages using a 3G dongle.

sudo apt install modem-manager-gui


I use california as a calendar.

sudo apt install california


Like a lot of people, I use VLC for numerous things.

sudo apt install vlc

Useful Tools

There are a lot of tools I use for various purposes.

sudo apt install whois veracrypt traceroute gparted audacity lynx subversion iotop hexchat openssl telnet-ssl gnutls-bin

An Almost Working System

At this point my XPS 13 was mostly setup how I wanted it to be. There have been a few issues I have experienced, however:

  • Sometimes the touchpad just stops working properly. Sometimes I can get it working again by tap-holding and dragging, but other times only a reboot will fix it.
  • The Wi-Fi is flaky. Setting txpower to 20 using sudo iwconfig wlp58s0 txpower 20 helps a bit, and disabling/enabling the Wi-Fi sometimes fixes things for a while, but doing that a lot resulted in me getting a USB type C Ethernet/LAN adapter.
  • Sometimes the USB type C Ethernet/LAN adapter doesn't operate properly after resuming from suspend and requires re-plugging.
  • After resuming from suspend, the list of wireless networks is empty and requires restarting network-manager.
  • If I resume from suspend and had a headset/headphones/speakers plugged into the 3.5 mm jack socket before the system entered a suspended state, I have to re-plug the jack, otherwise the system decides to use the built-in speakers.


For the touchpad, I added the following to /usr/share/X11/xorg.conf.d/51-synaptics-quirks.conf (obtained from the Ubuntu forums):

# Disable generic Synaptics device, as we're using
# "DLL0704:01 06CB:76AE Touchpad"
# Having multiple touchpad devices running confuses syndaemon
Section "InputClass"
	Identifier "SynPS/2 Synaptics TouchPad"
	MatchProduct "SynPS/2 Synaptics TouchPad"
	MatchIsTouchpad "on"
	MatchOS "Linux"
	MatchDevicePath "/dev/input/event*"
	Option "Ignore" "on"

It should be noted that even with this the touchpad still exhibited the problem, although three months after the clean install it does occur much less frequently.

BIOS and Firmware Updates

When I updated the BIOS I just copied the .exe to /boot/efi/ and then chose the update BIOS option from the F12 boot options menu.

For the firmware, the only way Dell seems to have made it possible to update it is using .exe files from a Windows environment.

Carefully thinking about why what I have tried didn't work, I have come up with the following list of reasons:

  • I can't boot from ISO on USB because Windows 7 PE doesn't have USB 3.0 drivers.
  • I can't boot from ISO on /boot/grml because Windows 7 PE doesn't have ext2 drivers.

Other options, like using MEMDISK, aren't possible because Windows 7 PE only uses INT 13h access at the start of the boot process (it forgets about the memory-mapped drive it booted from). Adding a driver to the WinPE image to overcome this (or one of the methods I actually tried) just looks like too much hassle.

Using a Windows 10 PE from Tag: WinPE at WindowsMatters didn't work. Using NTLite to add all the XPS 13 9350 chipset drivers to the boot.wim image in the Windows 10PE ISO also didn't work.

It is probably impossible at this time to update the Thunderbolt 3 firmware on an XPS 13 9350 Developer Edition. I don't know why Dell doesn't just do firmware updates through UEFI.

Firefox and Chrome Text Size

In Firefox, Chrome, and Chromium the text is way too big.

In Firefox, go to about:config and search for layout.css.devPixelsPerPx. Change the setting from -1 to something that looks OK to you (for me, 1.75 looked good).

For Chrome, open gnome-terminal.

nano ~/.local/share/applications/google-chrome.desktop

Change Exec=/opt/google/chrome/chrome %U to Exec=/opt/google/chrome/chrome --force-device-scale-factor=1.75 --high-dpi-support=1 %U, where 1.75 is the device scaling factor that looks OK to you.

For Chromium, open gnome-terminal.

sudo nano /usr/share/applications/chromium-browser.desktop

Change Exec=chromium-browser %U to Exec=chromium-browser --force-device-scale-factor=1.62 --high-dpi-support=1 %U, where 1.75 is the device scaling factor that looks OK to you.

While my system settings have a scaling factor of 1.62, a setting of 1.75 device pixels per pixel in both Firefox and Chrome looks OK to me.


On a default install, swappiness is set to 60.

According to that Wikipedia article, a swappiness of 100 is aggressive swapping, 60 is the default, 10 is recommended on systems with sufficient RAM, 1 for kernels 3.5 and later for minimal swapping without disabling it, and 0 for swapping only to avoid out of memory conditions.

As I have 16 gibibytes of RAM and have an NVME disk, I'd rather keep swapping down.

sudo nano /etc/sysctl.d/60-swappiness.conf
vm.swappiness = 10
sudo systemctl restart procps

As described in /etc/sysctl.d/README, 10-*.conf come from the procps package and are system defaults, 30-*.conf are installed by other packages, 60-*.conf and up are for end user settings, and 99-sysctl.conf is a symlink to /etc/sysctl.conf. A setting in a file with a higher number prefix will override the same configuration setting from a file with a lower number prefix.

One of the things I am aiming to do is to follow the correct way of doing things. Instead of modifying a configuration file (e.g. /etc/sysctl.conf) that can easily be modified by a package upgrade and forcing me to look at a diff of the file, I am instead just going to go with user configuration overrides where possible.

NVME Lifespan

According to Supermicro, the Toshiba THNSN5512GPU7 has a 0.3 DWPD. In other words, the expected life is 0.3 drive writes per day over the warranty period.

At a 512 GB capacity, that's 153.6 GB written per day over the warranty period. Several sites list a 3 year warranty period, giving an expected (warrantied) lifetime of 153.6 × 365 × 3 gigabytes, or 168,192 gigabytes before death.

With a bit of bash code, I can actually guesstimate how long until death with a one-liner.

sudo apt install bc nvme-cli

For my drive, I just need to set the parameters dwpd, warranty, and drive:

dwpd=0.3 warranty=3 drive=/dev/nvme0 gb=$(sudo nvme id-ns "$drive"n* | grep nsze | sed 's/.*: \(.*\)/\1/;s/,//g' | xargs -I '{}' printf '%d\n' {} | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/+/g' | xargs -I '{}' echo '({}) * 512 / 10^9' | bc) writes=$(sudo nvme smart-log $drive | grep written | sed 's/.*: \(.*\)/\1/;s/,//g' | xargs -I '{}' echo '{} * 1000 * 512 / 10^9 / 512' | bc -l) powerdays=$(sudo nvme smart-log $drive | grep hours | sed 's/.*: \(.*\)/\1/;s/,//g' | xargs -I '{}' echo '{} / 24' | bc -l) lifeused=$(echo "$writes / ($dwpd * $warranty * 365)" | bc -l) liferemaining=$(echo "$powerdays / $lifeused / 30" | bc -l) deathdate=$(date --date="+ $(echo "$liferemaining * 30 * 86400" | bc) seconds") hr=$(printf %80s | tr " " "-") sh -c 'echo "$hr\nDrive: $drive\nCapacity (GB): $gb\nData Writes Per Day (warranty): $dwpd\nWarranty Period (years): $warranty\nTotal Data Writes ($gb GB): $writes\nPower On Days: $powerdays\nLife Used (1.0 = 100%): $lifeused\nPredicted Life Remaining (months): $liferemaining\nExpected Death After Date: $deathdate\n$hr"'
Drive: /dev/nvme0
Capacity (GB): 512
Data Writes Per Day (warranty): 0.3
Warranty Period (years): 3
Total Data Writes (512 GB): 2.47059600000000000000
Power On Days: 54.95833333333333333333
Life Used (1.0 = 100%): .00752084018264840182
Predicted Life Remaining (months): 243.58241897906416124643
Expected Death After Date: Sat 30 Aug 04:02:54 BST 2036

For completion, if your NVME drive manufacturer specifies life in TBW (terabytes written), this one-liner just requires the parameters tbw and drive:

tbw=168 drive=/dev/nvme0 gb=$(sudo nvme id-ns "$drive"n* | grep nsze | sed 's/.*: \(.*\)/\1/;s/,//g' | xargs -I '{}' printf '%d\n' {} | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/+/g' | xargs -I '{}' echo '({}) * 512 / 10^9' | bc) writes=$(sudo nvme smart-log $drive | grep written | sed 's/.*: \(.*\)/\1/;s/,//g' | xargs -I '{}' echo '{} * 1000 * 512 / 10^9 / 1000' | bc -l) powerdays=$(sudo nvme smart-log $drive | grep hours | sed 's/.*: \(.*\)/\1/;s/,//g' | xargs -I '}{' echo '}{ / 24' | bc -l) lifeused=$(echo "$writes / $tbw" | bc -l) liferemaining=$(echo "$powerdays / $lifeused / 30" | bc -l) deathdate=$(date --date="+ $(echo "$liferemaining * 30 * 86400" | bc) seconds") hr=$(printf %80s | tr " " "-") sh -c 'echo "$hr\nDrive: $drive\nCapacity (GB): $gb\nTerabytes Written (warranty): $tbw\nTotal Writes (TB): $writes\nPower On Days: $powerdays\nLife Used (1.0 = 100%): $lifeused\nPredicted Life Remaining (months): $liferemaining\nExpected Death After Date: $deathdate\n$hr"'
Drive: /dev/nvme0
Capacity (GB): 512
Terabytes Written (warranty): 168
Total Writes (TB): 1.26494668800000000000
Power On Days: 54.95833333333333333333
Life Used (1.0 = 100%): .00752944457142857142
Predicted Life Remaining (months): 243.30406141722446014816
Expected Death After Date: Thu 21 Aug 19:38:11 BST 2036

Magic SysRq Key

By default on Ubuntu Xenial, the bitmask used for kernel.sysrq is 176. In terms of the REISUB (busier backwards, or Reboot Even If System Uber Borked), only SUB will cause something to happen (sync filesystems, remount read-only, reboot).

To have the REI (unraw keyboard, send SIGTERM to all processes excluding systemd, send SIGKILL to all processes excluding systemd), the bitmask needs to have 68 added to it (4 for keyboard control, 64 for process control).

sudo nano /etc/sysctl.d/60-magic-sysrq.conf
kernel.sysrq = 244
sudo systemctl restart procps
sudo tail -n0 -f /var/log/syslog

To test SysRq commands work, tailing the syslog and attempting to sync the filesystems (S) is safe. Just make sure the only letter your finger(s) touch is the S key.

Fortunately, there is no ugly key combination to use SysRq on my XPS 13. To sync all filesystems all I had to do was use the key combination Alt+PrintScr+S.

Aug 28 00:40:40 XPS-13-9350-JC kernel: [480624.932206] sysrq: SysRq : Emergency Sync
Aug 28 00:40:40 XPS-13-9350-JC kernel: [480624.979886] Emergency Sync complete

Speed Limiting APT

I have a lot of download bandwidth. Unlimited upload bandwidth, however, is not something available to servers.

APT can sometimes use so much of my download throughput that it actually causes a spike in latency. Not throttling APT can be bad for both my connection and the connections of those serving the repositories (although some servers may have more of an issue with simultaneous connections so slower may not always be better).

In order to resolve this issue, I have decided to limit my APT speeds to 5 Mb/s download.

sudo nano /etc/apt/apt.conf.d/76download
	Queue-mode "access";
		Dl-Limit "625";

When queue-mode is access, one connection per protocol (HTTP, FTP) will be used, whereas queue-mode set to host will open one connection per hostname.

The setting Dl-Limit limits APT's download bandwidth, and the setting value is in kilobytes per second (KB/s). This setting also disables downloading from multiple hosts simultaneously.

For more information on the settings, see man 5 apt.conf.

Dell APT Repositories

Before doing a clean install, I copied the contents of /etc/apt/ to an SD card.

While /etc/apt/sources.list and /etc/apt/apt.conf.d/ don't look like they have anything Dell-specific, /etc/apt/sources.list.d/ did have some Dell-specific repositories:

  • trusty-dell.list
  • trusty-dell-biz-vivid-skl.list
  • trusty-dell-dino2.list
  • trusty-oem.list
  • trusty-oem-sp1.list
find /media/thejc/1274-9715/apt/sources.list.d/ -iname '*.list' -print0 | xargs -0 -I '{}' /bin/sh -c 'echo "In {}:\n\n$(cat {})\n\n"'
In /media/thejc/1274-9715/apt/sources.list.d/trusty-dell-dino2.list:

deb trusty-dell-dino2 public
deb-src trusty-dell-dino2 public

In /media/thejc/1274-9715/apt/sources.list.d/trusty-oem.list:

deb trusty-oem public
deb-src trusty-oem public

In /media/thejc/1274-9715/apt/sources.list.d/sources-backup.list:

In /media/thejc/1274-9715/apt/sources.list.d/trusty-oem-sp1.list:

deb trusty-oem-sp1 public
deb-src trusty-oem-sp1 public

In /media/thejc/1274-9715/apt/sources.list.d/trusty-dell.list:

deb trusty-dell public
deb-src trusty-dell public

In /media/thejc/1274-9715/apt/sources.list.d/trusty-dell-biz-vivid-skl.list:

deb trusty-dell-biz-vivid-skl public
deb-src trusty-dell-biz-vivid-skl public

There aren't (currently) any repositories worth adding to apt. Looking at, the only repository possibly worth adding is the distribution xenial-dell-dali-astro-kbl, but only if you have an Nvidia card as it just contains some newer nvidia packages (at the time of writing the latest version of libcuda1 on Xenial was libcuda-361, xenial-dell-dali-astro-kbl has libcuda-367).

I believe Dell have moved towards integrating stuff within the distro repositories so there isn't much need for adding the OEM repositories.


The XPS 13 9350 Developer Edition mostly works out of the box, although Wi-Fi and the touchpad were problematic—I'm not sure if recent updates have fixed the touchpad issue, and as for the Wi-Fi issues I use Ethernet almost 100% of the time.

The USB-C/Thunderbolt 3 issue with the Ethernet adaptor randomly not working properly and needing to be unplugged and inserted to start working again is still an issue, as is the audio output device switching back to the internal speakers on boot and after suspend.

There is currently no way to update the Thunderbolt 3 controller firmware from within Ubuntu or UEFI, so it is impossible to know if a recent firmware update fixes things with the Ethernet adapter.

Ubuntu currently has issues if you try to install Unity/GNOME together with KDE, so it is probably best avoided for the time being.

While you can install Unity and GNOME together, they currently do not play well together when it comes to text scaling.

Some applications aren't that great at scaling their interfaces, such as MakeMKV and Jitsi.

Despite the unresolved problems, after 3 months of use this ultrabook is now my main computer. With a 3200×1800 "4K" display, and 1.62 scaling giving an approximate 1080p desktop (in terms of the GUI) with a higher pixel density, the smaller computer size means the screen is actually approximately the same size as my Alienware m17x R3 to my eyes because I am physically closer to it.

In fact the only time I turn on my Alienware now is when I need to use the BD drive or want to play a game, not that I have played any games recently.


For the most part, the performance is good. The only times I notice any sluggishness is when a Web site is badly designed (e.g. Halifax online banking was using 100% CPU the other day), or I am doing something unwise such as streaming a YouTube video in 4K resolution in a window snapped to one side of the screen effectively trying to fit 4K of image into less than 1080p worth of pixels.

I went with the i7-6560u option over the i5-6200u mainly because of the Iris 540 graphics and the larger CPU cache. Looking at Dell's UK site right now, there is only one configuration of the XPS 13 Developer Edition available (unlike the US site—replace uk with us in Dell's URL to switch site) and it is just not good enough for my intended use (i5-6200U, 8 GiB RAM, 256 GB PCIe SSD, 1080p, non-Iris graphics). This was the case for several months before my purchase (if it was for sale at all) so I kept delaying the purchase until the specs I wanted were available on the UK site.

The PCIe SSD is fast to read from despite the LUKS encryption having a performance hit, as shown in this simple read test:

sudo dd if=/dev/nvme0n1p3 bs=4M count=1024 of=/dev/null
1024+0 records in
1024+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 3.76049 s, 1.1 GB/s
sudo dd if=/dev/mapper/NVME-Var bs=4M count=1024 of=/dev/null
1024+0 records in
1024+0 records out
4294967296 bytes (4.3 GB, 4.0 GiB) copied, 5.26775 s, 815 MB/s

Or alternatively, a benchmark using gnome-disks on /dev/NVME/RootHome:

  • Disk or Device: 1.0 GB Block Device (/dev/NVME/RootHome)
  • Last Benchmarked: Sat 10 Sep 2016 05:47:37 BST (1 minute ago)
  • Sample Size: 10.0 MiB (10,485,760 bytes)
  • Average Read Rate: 906.2 MB/s (100 samples)
  • Average Write Rate: 528.5 MB/s (100 samples)
  • Average Access Time: 0.11 msec (1000 samples)

It may not be the fastest available, but it is faster than SATA 6 Gb/s. While 512 GB is not a lot of disk space, I can upgrade to a larger NVME drive at a later date when the capacities available increase and the prices come down. Until then, I can utilise my home server's 23 TB of storage space.