Installing Ubuntu on Dell XPS 13

Today I got my new Dell XPS 13. Being an Macbook user for the past 5-6 years, this was quite exciting for me; I finally got to run Linux on the desktop again!

So, I created the USB installation stick in Windows and booted to the Live system.

First “bump” was the Dell Wireless network interface that the laptop came with. It’s a Broadcom BCM4352 chip which has a properitary driver.

root@ubuntu:~# lspci -v | grep -i bcm
02:00.0 Network controller: Broadcom Corporation BCM4352 802.11ac Wireless Network Adapter (rev 03)

The required packages is included on the USB installation stick, so it’s just a matter of installing them (this would have to be repeated once booting into the freshly installed system):

sudo dpkg -i /cdrom/pool/main/d/dkms/dkms_2.2.0.3-2ubuntu3_all.deb
sudo dpkg -i /cdrom/pool/restricted/b/bcmwl/bcmwl-kernel-source_6.30.223.248+bdcom-0ubuntu2_amd64.deb

After the installation and restarting the laptop it couldn’t find any bootable devices(!). Reading the release notes, this is a known problem. The bug 1499323 has a workaround.

To enable palm detection, which should have a similar effect as above:

sudo apt-get install xserver-xorg-input-libinput

Then create /etc/X11/xorg.conf.d/99-libinput.conf:

Section "InputClass"
    Identifier "libinput"
    Driver "libinput"
    MatchDevicePath "/dev/input/event*"
    MatchIsTouchpad "true"
    Option "Tapping" "true"
    Option "TappingDragLock" "true"
    Option "ClickMethod" "none"
    Option "NaturalScrolling" "false"
EndSection

The above settings should make the touchpad behave “similar” to an Apple touchpad.

To improve battery life you can install TLP:

TLP brings you the benefits of advanced power management for Linux without the need to understand every technical detail. TLP comes with a default configuration already optimized for battery life, so you may just install and forget it. Nevertheless TLP is highly customizable to fulfil your specific requirements.

As of 15.10, tlp is part of the official repositories, if you’re running an earlier release:

sudo add-apt-repository ppa:linrunner/tlp

It is easy as:

sudo apt-get update
sudo apt-get install tlp tlp-rdw gsmartcontrol smart-notifier

Bluetooth does not work out-of-the box. To get it working, we need a firmware file from the Windows driver. Good guy hg8 has it available on github.com for us.

wget https://github.com/hg8/bluetooth-firmware-XPS13-9343/blob/master/BCM20702A0-0a5c-216f.hcd
sudo mv BCM20702A0-0a5c-216f.hcd /lib/firmware/brcm/
sudo ln -s /lib/firmware/brcm/BCM20702A0-0a5c-216f.hcd /lib/firmware/brcm/BCM20702A1-0a5c-216f.hcd

Change the bluetooth device name with:

sudo -i
echo "PRETTY_HOSTNAME=$HOSTNAME" > /etc/machine-name
systemctl restart bluetooth.service

Additional resources:

Asus EEE 901 och Ubuntu EEE

I bought an Asus EEE 901 today. I chosed the black model with Windows XP. But it didn’t take long time before I installed Ubuntu EEE, which is a tailor made Ubuntu based distribution.

On their homepage there are some optimization guides. I started with How to: Reduce Disk Writes to Prolong the Life of your Flash Drive [ubuntu-eee.com]. I skipped the second part of the commands under “blkid.tab and mtab”, since I wanted to continue with Transparent Encryption for home folder [ubuntu-eee.com] which uses FUSE.

I followed the guide mostly step by step, except I didn’t add pam_encfs.so in /etc/pam.d/common-session. That line make sure that the volumes is unmounted when logging out, but it resulted in some error messages every time I ran a command with sudo:

umount: /home/mikael: device is busy
umount: /home/mikael: device is busy

I’m not really sure what sudo is up to, but it seems like the login process for users ends, which results in trying to unmount the home directory.

Eyecandy is a must, it was however not possible to enable them via “System”, “Settings”, “Apperance”, “Visual effects”. So I had to install them manually and then activate them.

sudo apt-get install compiz compizconfig-settings-manager avant-window-navigator

The first package enables visual effects in genera, the second is for being able to configure the visual effects and the third is a Mac OS X-like dock. Recommended effects are “Rotating Cube”, “Reflection Cube” and “Ring switcher”.

Next step was to get my Huawei E220 3G modem working. Fortunately, people had already solved that problem: Mobitel 3G with Huawei E220 on Debian [sayura.net]. I skipped the udev rule and the associated script since I didn’t want it to connect automagically when detected. When I want to connect, I plugin the modem, click on the NetworkManager applet and uncheck “Enable wireless”, then right-click on the same applet, chose “Dial Up Connections” and “Connect to ppp0 via modem…”. Unfortunately there’s a bug in NetworkManager that makes it not possible to detect a working connection that has been configured outside of it, this results in Firefox running in offline-mode. Since Firefox 3.0.1 the way to get around this is to configure “toolkit.networkmanager.disable” to “true” through “about:config”.

A really annoying thing is that pipe (|) doesn’t work in the terminal. A quick google search took me to skrivmaskin.se/linux. I never use caps-lock, so let’s remapping it to |:

echo "setxkbmap -option ctrl:nocaps" >> ~/.bashrc
echo " xmodmap -e \"keycode 66 = bar\"" >> ~/.bashrc

Bluetooth worked out-of-the-box, as long as the feature was activated in BIOS. “Accessories”, “Bluetooth File Sharing” was the only thing needed to get it work. It does however have a really ugly icon in the menu bar, so with the help of strace I found out which icon it was using and replaced it with something that suited my taste. There are 6 pictures which has to be replaced in /usr/share/gnome-bluetooth/pixmaps: frame1.png, frame2.png, ..., frame6.png.

The end result: