Debian/Linux on Sony VAIO Pro 13
I recently wanted to order a new laptop from work, and due to the ignorance of Lenovo I couldn’t get my preferred Thinkpad T41 in time for the end of the financial year. So I went for a Sony VAIO Pro 13 model. Having used a VAIO Z series laptop for quite some time, including maintaining soem extensions of the sony-kernel modules for some time, and implementing rfkill applets for Gnome, I expected a few problems with the new hardware.
Fortunately some other people have already posted various information on how to get the laptop properly running on linux, that helped. At the end it took me about two days to shrink Windows8.1, get linux to boot and run, move about 300Gb of data from the old laptop to the new, carry over all the configuration changes and adaptions, and tweak the behaviour. At the moment the laptop is in decent state with most things working properly, including suspend, wlan, multi-boot, etc.
As delivered the laptop comes with Windows 8.1, and 6 different partitions:
- partition 1: fat32, EFI system partition, hidden
- partition 2: ntfs, Basic data partition, hidden, diag – contains WindowsRE
- partition 3: fat32, EFI system partition, boot partition
- partition 4: non-allocated, Microsoft reserved partition
- partition 5: ntfs, Windows data
- partition 6: ntfs, hidden, diag – contains the full Sony factory restore data
Step 1: shrinking Windows 8.1
I first tried the internal Windows shrink functionality, but it didn’t allow me to shrink below 230Gb, and I didn’t want to waste so much space for Windows. parted also refused to work with newer ntfs file systems, so I ended up downloading the AOMEI Partition Assistant. Using this one I shrinked the Windows main partition (number 5) to 100Gb and thus freed about 350Gb for Linux.
Step 2: preparing the BIOS
Shut down the computer, turn it off. When turned off, press the Assist button. This brings you into the VAIO Care Recovery Interface – in my case all in Japanese. Select F2 or press the BIOS button to configure the BIOS. In the BIOS the following settings have to be changed:
- disable secure boot
- enable booting from external devices
- enable booting from USB and move it to the top of the list
That are all steps necessary. In case your Windows 8.1 complains by displaying a stupid message in the lower right button of your screen that secure boot is not configured correctly, go to this Microsoft Knowledge Base article, download the update, and run it.
Step 3: installing Linux
For installation one needs a Debian installer that supports UEFI, which seems to be available since about August 2013. Guided by my friend Mattia’s description, I downloaded the daily snapshot netinstaller image (firmware included!), dumped it onto an unused USB stick with
cat firmware-testing-amd64-netinst.iso > /dev/sd
sfdisk -R /dev/sd
(adapting the sd part accordingly!), and booted into the USB stick.
Warning: If you use one of the default installation cd images they may not contain the non-free firmwares necessary to get the Intel chipset running. In this case I recommend having a USB-Ethernet adapter at hand.
Installation then proceeds as ususal, I just selected guided partitioning of the biggest available space and the third partition (sda3) as EFI boot partition.
Important: Before finishing the installation, fixing the boot loader is necessary!
Step 4: Fixing the boot loader
Step 4.1: Fix Grub-Efi locations
I first tried to reboot without further changes, but that threw me straight into Windows, so I followed again Mattia’s advice:
- Before rebooting change to the second console and press to active it
- Go to /target/boot/efi/EFI, there should be three directories:
- Boot/: the original boot loader
- Microsoft/: microsoft chain loader
- debian/: the Grub EFI boot loader
- Do the following freshuffling:
mv Boot Boot.orig
mv debian Boot
cp Boot/grubx64.efi Boot/bootx64.efi
Step 4.2: Fix linux kernel command line
According to this post, and also in my experience with the newest kernels, it is necessary to add an entry to the linux cmdline. For this, edit /target/etc/default/grub to include
(the default is only the quiet part). After rebooting once, run update-grub.
After that a reboot brought me into the grub menu, from which I could boot both linux and windows. Yeah, all settled.
Step 5: Update to unstable
After rebooting into linux again, I changed my sources to sid (unstable) and upgraded all packages. The current kernel is 3.13 and that is fine enough as far as I see.
Step 6: Home-made kernel with sony-laptop updates
I cloned the current linux.git and merged Mattia’s sony-laptop branch for_3.15 into it, so that I have the newest support in the sony-laptop kernel module. But this is only for those who fancy building their own kernels. In principle that is:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git pull git://git.taihen.jp/linux-sony-2.6.git for_3.15
I used this config file for building the kernel where most features are compiled in, and most other things disabled. This is the kernel I am currently running (as of today 2014-03-30).
Step 7: iwlwifi firmware update
Update 2014-04-11: The following alone is not good enough, one needs also an update to either kernel 3.15 (when it is out) or include the wireless-testing git repository. See the followup article for details.
The iwlwifi firmware/driver seems to have some problems. It took always ages until packets actually went over the link, although the network manager told me it is connected. I downloaded the respective firmware iwlwifi-7260-8.ucode from the linux-firmware git repository with and copied the file into /lib/firmware (overwriting the copy from the package firmware-iwlwifi). This (hopefully) fixed most problems regarding wifi for me.
lspci -k output
00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09) Subsystem: Sony Corporation Device 90b6 00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09) Subsystem: Sony Corporation Device 90b6 Kernel driver in use: i915 00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 09) Subsystem: Sony Corporation Device 90b6 Kernel driver in use: snd_hda_intel 00:14.0 USB controller: Intel Corporation Lynx Point-LP USB xHCI HC (rev 04) Subsystem: Sony Corporation Device 90b6 Kernel driver in use: xhci_hcd 00:16.0 Communication controller: Intel Corporation Lynx Point-LP HECI #0 (rev 04) Subsystem: Sony Corporation Device 90b6 Kernel driver in use: mei_me 00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio Controller (rev 04) Subsystem: Sony Corporation Device 90b6 Kernel driver in use: snd_hda_intel 00:1c.0 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 3 (rev e4) Kernel driver in use: pcieport 00:1c.3 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 4 (rev e4) Kernel driver in use: pcieport 00:1c.4 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 6 (rev e4) Kernel driver in use: pcieport 00:1d.0 USB controller: Intel Corporation Lynx Point-LP USB EHCI #1 (rev 04) Subsystem: Sony Corporation Device 90b6 Kernel driver in use: ehci-pci 00:1f.0 ISA bridge: Intel Corporation Lynx Point-LP LPC Controller (rev 04) Subsystem: Sony Corporation Device 90b6 Kernel driver in use: lpc_ich 00:1f.3 SMBus: Intel Corporation Lynx Point-LP SMBus Controller (rev 04) Subsystem: Sony Corporation Device 90b6 01:00.0 Network controller: Intel Corporation Wireless 7260 (rev 6b) Subsystem: Intel Corporation Dual Band Wireless-AC 7260 Kernel driver in use: iwlwifi 03:00.0 SATA controller: Samsung Electronics Co Ltd XP941 PCIe SSD (rev 01) Subsystem: Samsung Electronics Co Ltd Device a811 Kernel driver in use: ahci
I will surely have more things to say until this new piece is running properly … but for now it is ok.
- Mattia’s wiki page: http://www.linux.it/~malattia/wiki/index.php/Vaio_Pro_11
- Crunchbang Linux Install Vaio Pro 13: http://www.linuxquestions.org/questions/blog/rearden888-507430/crunchbang-linux-install-vaio-pro-13-35783/