OpenSUSE Tumbleweed in Dell XPS 13

Kuko Armas <kuko@canarytek.com>
| ,

A couple days ago I got my new Dell XPS 13 Laptop. This post is just a collection of tips and documentation to make it work wit openSUSE Tumbleweed

Installation

I download the last Tumbleweed ISO (20170529) and installed it. The installation process didn’t adapt the size to the HiDPI screen, so the font was too small and reading was a bit painfull, but once installed, Gnome adapted the size to the HiDPI screen and it was usable out of the box (without tweaking gnome settings)

Disk encryption

I always encrypt the data volumes in all my laptops (and you should, also)

The encrypted LVM proposal I used in my first try didn’t work because, after installation, Linux couldn’t boot. Probably grub2 didn’t initialize the encrypted PV correctly

I mentioned this problem with the SuSE Canary Team (good friends of mine) and they told me they already knew the problem and where working to fix it.

As a workaround, I decided to install using the plain LVM proposal and encrypt the home and swap volumes manually after installation

Encrypting LVM volumes after installation

I will encrypt the home and swap volumes

I will use the names safe-home and safe-swap to the unencrypted devices

  • Login as root
  • Copy all the home data to a temporary location and unmount /home
cp -av /home /home.safe
umount /home
  • Disable swap volume
swapoff -a
  • Initialize luks in the swap and home LV (choose a GOOD password, use the same in both LV)
crypsetup luksFormat /dev/system/swap
crypsetup luksFormat /dev/system/home
  • Check that the luks devices are correctly created
crypsetup luksDump /dev/system/swap
crypsetup luksDump /dev/system/home
  • Open both devices
cryptsetup open /dev/system/swap safe-swap
cryptsetup open /dev/system/home safe-home
mkswap /dev/mapper/safe-swap
  • Format as swap (swap) and XFS (home)
mkswap /dev/mapper/safe-swap
mkfs -t xfs /dev/mapper/safe-home
  • Mount /home and copy the saved data
mount /dev/mapper/safe-home /home
cp -av /home.safe/* /home
  • Now we need to setup the system to initialize the the luks device on boot, and use the unencrypted devices on fstab
  • Add the following entry to /etc/crypttab
safe-swap /dev/mapper/sys-swap none luks
safe-home /dev/mapper/sys-home none luks
  • Change the swap entry in fstab to use the unencrypted device (/dev/mapper/safe-swap)
  • Change the home entry in fstab to mount the unencrypted device (/dev/mapper/safe-home)

  • Update initrd to initialize luks devices
dracut --force
  • Reboot. It should prompt for a password

Changing text console resolution

Due to the HiDPI screen, with the default video configuration, the font is unreadable in text mode. Y changed the video mode to a more readable resolution. I also modified grub to do a non-quiet text boot

  • In /etc/default/grub, setup the following entry
GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/system/swap showopts video=1024x768"
  • And generate a new grub config
grub2-mkconfig -o /boot/grub2/grub.cfg

WARNING With the text mode boot, it’s not clear when it’s asking you to type the password used to encrypt the disk. Just type the password when the boot stops, even if you don’t see any prompt asking for a password

Dell TB16 USB-C Docking Station

  • Multiscreen Video: works out of the box (VGA+DisplayPort). HDMI not tested
  • Keyboard + Mouse: Not working. Will keep testing
  • LAN: Not working. Will keep testing

Dell DA200 USB-C Adaptor (HDMI+VGA+LAN+USB)

  • VGA: Working
  • HDMI: Not working. Seems to be a known bug in intel-drm lib
  • USB Keyboard + Mouse: Working
  • LAN: Not tested

Non HiDPI external screens

  • I switch between HiDPI laptop screen and normal DPI external screens (at home and office). Since GNOME Shell does not seem to “remember” the DPI and scale settings I set on each configuration, the fastest way I’ve found to switch is creating a shell script and switching manually (I’m a CLI guy ;). This is the script I’m using
#!/bin/bash

case $1 in
  "test")
    ## Generically if your HiDPI monitor is AxB pixels and your regular monitor is CxD and you are scaling by [ExF], the commandline for right-of is:
    ## xrandr --output eDP-1 --auto --output HDMI-1 --auto --panning [C*E]x[D*F]+[A]+0 --scale [E]x[F] --right-of eDP-1
    #xrandr --output eDP-1 --auto --scale 1x1 --dpi 96 --output DP-1-2 --auto --panning 3840x2160+3200+0 --scale 2x2 --dpi 96 --right-of eDP-1
  ;;
  "casa")
    xrandr --output eDP-1 --off --output DP-1 --auto --primary --dpi 96
    gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "[{'Gdk/WindowScalingFactor', <1>}]"
    gsettings set org.gnome.desktop.interface scaling-factor 1
  ;;
  "ofi")
    xrandr --output eDP-1 --off --output DP-1-3 --auto --noprimary --dpi 96 --output DP-1-2 --auto --primary --dpi 96 --right-of DP-1-3
    gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "[{'Gdk/WindowScalingFactor', <1>}]"
    gsettings set org.gnome.desktop.interface scaling-factor 1
  ;;
  "off")
    xrandr --output eDP-1 --auto --scale 1x1 --primary --output DP-1 --off --output DP-1-2 --off --output DP-1-3 --off
    gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "[{'Gdk/WindowScalingFactor', <2>}]"
    gsettings set org.gnome.desktop.interface scaling-factor 2
  ;;
  *)
  echo "Usage: $0 [on|off]"
  ;;
esac
  • Changing DPI in google-chrome Chrome doesn’t change the DPI settings on the fly when I switch DPI modes, I need to restart chrome. To do it faster I created a bookmark pointing to chrome://restart which is a “magic” URL that forces a restart keeping all tabs