Monthly Archives: August 2015

Ubuntu on 2015 Thinkpad Carbon X1

This week Disney gave me a 2015 Thinkpad Carbon X1 and I set it up to run Ubuntu. I choose XUbuntu because it has a smaller disk footprint than Ubuntu, the desktop uses less RAM and CPU, and I prefer XFCE’s simple old fashioned desktop over Unity. Yet the only difference is the desktop – it is the same Ubuntu under the covers, so it has the most up-to-date repos and is one of the most popular distros, which means good support.

This Carbon X1 is really nice – Disney gives us great hardware. i7 processor, 8 GB RAM, 256 GB SSD, and 1920×1080 non-touch screen. Being a fast typist and keyboard snob, I will say this laptop has the best keyboard I have ever used on a laptop. Better than my Macbook Air, and far better than the terrible keyboard on the Dell XPS-13. And this X1 is one fast machine. It puts my Macbook Air to shame.

The 2015 X1 has Broadwell processors and the longer battery life they make possible. It runs Ubuntu right out of the box, basically works including bluetooth, networking, wifi, even the docking box. But there are some bugs that require tweaking to fix. This is what this blog is all about.

Suspend/Wake

First, I observed that it wouldn’t wake properly from suspend. Upon wake I got a screen that was solid black or garbled.

The first thing I tried was adding the “nomodeset” parmeter to the linux kernel:

sudo vi /etc/default/grub
---
GRUB_CMDLINE_LINUX="nomodeset"
---
sudo update-grub
sudo reboot

This fixed suspend/wake but broke the display brightness function keys. The display was stuck at max brightness. Long story short, for both to work I reverted the above change and did the following:

sudo vi /usr/share/X11/xorg.conf.d/20-intel.conf
---
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "uxa"
EndSection
---
sudo reboot

Networking

Sometimes networking won’t connect. This happens wired – ethernet to USB or in the dock, and wireless. Once connected it’s solid; this bug is about initiating a network connection. Disabling and re-enabling networking and wireless don’t fix it. The network settings are often greyed out on the system menu, with no explanation. There’s nothing obvious I can find in the dmesg logs.

It took me a few weeks but I finally figured this out. First use rfkill, which usually fixes it. If not, restart the network manager service. Or just run this script:

#!/usr/bin/env bash
sudo rfkill block all
sleep 2
sudo rfkill unblock all
sleep 2
sudo service networking restart
sudo service network-manager restart
sudo resolvconf -u

Power Management

Ubuntu 15.04 has a feature (I use the word loosely) that cools the CPU by scheduling kernel threads that hog a timeslice while idling. This is redundant and overly complex. There are already 2 ways the laptop cools the CPU: (A) slow down the clock speed, or (B) turn on the fan. Which to use depends on whether you want battery life or performance.

This new feature will have your laptop suddenly become slow and unresponsive at seemingly random times for no apparent reason, and you’ll see mysterious idle threads hogging the CPU.

To disable this blacklist the intel_powerclamp module:

sudo vi /etc/modprobe.d/blacklist.conf
---
# blacklist intel powerclamp, a redundant and overly complex way to keep the CPU cool
blacklist intel_powerclamp
---
sudo update-initramfs -u
sudo reboot

Another action you can take to improve battery life is to enable power save mode:

sudo pm-powersave true

VirtualBox, Windows, and Samba Shares

Disney uses Exchange email, so I created a Windows 7 VirtualBox VM to run Outlook. Thanks to my MSDN subscription, I also have Office 365 but prefer using LibreOffice most of the time.

To access the Linux filesystem from the Windows VM, I create a Samba share in Ubuntu accessible only to my local user and map it to a network drive in the VM. This works mostly fine. But whenever the VM is (re)started, it can take 30 seconds or so before the fileshare is accessible. During this time, Outlook expects to see the drive, gets confused and hangs. It remains unresponsive even after the drive becomes accessible. It must be killed and restarted, which sometimes corrupts the PST file.

I discovered there is a workaround for this. Define the samba share in Virtualbox (in the settings for the VM) instead of in Ubuntu. When I do this, the share is immediately accessible every time the VM (re)starts. No more Outlook hangs and corrupted PST files.

Summary

With these simple changes, my X1 is running XUbuntu 15.04 smoothly and reliably. Even session swapping between users is working! If I encounter any other issues I’ll report them and solutions here.