Kubuntu on ASUS Zenbook Prime UX31A-DH5


After a few problems I can confirm ASUS Zenbook Prime UX31A-DH5 working with Kubuntu 13.10. Here are the steps I did:

Get kubuntu from http://www.kubuntu.org/getkubuntu/download
At the time of writing, version 13.10 was the most recent. It should work with BIOS Secure Boot option.

Copy iso image to usb device

dmesg

[67675.270470] sdf: sdf1 sdf2
[67675.335259] sd 8:0:0:0: [sdf] No Caching mode page found
[67675.335261] sd 8:0:0:0: [sdf] Assuming drive cache: write through
[67675.335263] sd 8:0:0:0: [sdf] Attached SCSI removable disk

dd if=kubuntu-13.10-desktop-amd64.iso of=/dev/sdf

Create a partition where ubuntu will be installed. In Windows 8 under Settings -> Control Panel -> Administrative Tools -> Computer Management -> Storage -> Disk Management –> Shrink Volume

BIOS update
Updated bios to 219 version. Make sure you have correct model, in my case its UX31A. Go to assus support site and get the BIOS file. Copy the BIOS file onto a USB stick. Reboot and press the esc button to enter the BIOS menu. Then select “Enter Setup”. From the Advanced tab, choose the Easy Flash option and then select the BIOS file to update.

Installing from a Live USB
Reboot than press and hold ESC for boot menu. I had trouble booting from one USB key and had to use another. Eventually the USB device got recognized and I got grub2 menu. After selecting kubuntu, the screen went black!1&(^$!@(*^& I connected external monitor and viola, ubuntu was there. See this bug.

Selected manual partitions, created 4GB swap and ~33GB / ext4 partition and proceeded with install.

Update
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-update

Black screen after the 1st boot
Kernel 3.11 has a bug with intel4000
Laptop screen black due to this bug. It is fixed in kernel-3.12, however this patch is not included with Kubuntu-13.10 :(. Kernel can be updated to v 3.12 as described here:


mkdir kernel\ v3.12.2-trusty && cd kernel\ v3.12.2-trusty

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.12.2-trusty/linux-image-3.12.2-031202-generic_3.12.2-031202.201311291538_amd64.deb--2013-11-30 18:47:15-- http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.12.2-trusty/linux-image-3.12.2-031202-generic_3.12.2-031202.201311291538_amd64.deb

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.12.2-trusty/linux-headers-3.12.2-031202_3.12.2-031202.201311291538_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.12.2-trusty/linux-headers-3.12.2-031202-generic_3.12.2-031202.201311291538_amd64.deb

sudo dpkg -i linux-*.deb
sudo update-grub
sudo reboot now

My Zenbook now properly boots with laptop screen working as it is supposed to!

Other tips
Some other tips for power saving optimization include modifying kernel parameters:

sudo nano -w /etc/default/grub

modify to include:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi='!Windows 2012' pcie_aspm=force drm.vblankoffdelay=1 i915.semaphores=1 nmi_watchdog=0"

and update grub with
sudo update-grub

SSD tweeks
Increase the life of your SSD by reducing number of OS writes to SSD
sudo nano -w /etc/fstab

and add discard,noatime,nodiratime params to your SSD partition as well as tmpfs. noatime disable (or significantly reduce) disk writes whenever a file is read. nodiratime gives you the same functionality for directories. discard filesystem option is for automatic/online TRIM.

UUID=0d67e753-acb6-46c4-acb4-1bd4f14fe92c /               ext4    discard,noatime,nodiratime,errors=remount-ro 0       1
tmpfs /tmp tmpfs defaults,discard,noatime,mode=1777 0 0

Make sure deadline is used as IO Scheduler


sudo cat /sys/block/sda/queue/scheduler
noop [deadline] cfq

Swap
Most systems with more than 2GB RAM rarely use swap space except for hibernate. Reduce usage of swap space in order to minimise number of writes to swap with


sudo echo 1 > /proc/sys/vm/swappiness

alternatively, this can be done by modifying sysctl

sudo nano -w /etc/sysctl.d/99-sysctl.conf

to look like

vm.swappiness=1
vm.vfs_cache_pressure=50

Resolution
Current Xorg-server uses a display resolution setting of 96dpi by default. UX31E Zenbooks have a resolution of ~138dpi. The default value of 96dpi makes fonts look really small. You can list the current setting with:

xdpyinfo|grep resolution

Override the default value with

xrandr --dpi 138/eDP1

To keep this permanent add xrand call to /etc/X11/xinit/xinitrc
sudo nano -w /etc/X11/xinit/xinitrc

Touchpad
Right and middle mouse clicks are not working. This needs specific xinput instruct. A quick recipe is given here. Create an executable script:

sudo nano -w /usr/local/bin/touchpad.sh
chmod +x /usr/local/bin/touchpad.sh

and add the following code

#!/bin/bash 
xinput set-prop "ETPS/2 Elantech Touchpad" "Synaptics ClickPad" 1 
xinput set-prop "ETPS/2 Elantech Touchpad" "Synaptics Soft Button Areas" 1956 0 1737 0 1304 1955 1737 0 
syndaemon -i 1.7 -d -t -K 

Lastly start this script
/usr/local/bin/touchpad.sh

To make it permanent add it to SystemSettings–>Startup and Shutdown–>AutoStart

Skype
Skype is not in official repos, to install it add ‘partner’ repository.

sudo add-apt-repository "deb http://archive.canonical.com/ $(lsb_release -sc) partner"
sudo apt-get update
sudo apt-get install skype

,