The MacBookAir4,2 works well with Ubuntu 12.04 Precise Pangolin. Earlier versions of Ubuntu work less well and need significant, expert setup. At present, configuring an Ubuntu installation on the MacBookAir is likely to prove difficult for someone with no prior experience of using Linux. Novices users might be better to use VirtualBox to install Ubuntu in a virtual machine.

For further discusion and to seek help, see Ubuntu MacBookAir 4 thread in the Ubuntu Forums.

MacBookAir 4,2 and Ubuntu 12.04

This page aims to describe the steps needed to fully enable all features of the 13 inch 4th Generation MacBookAir (release date: July 2011) when using Ubuntu 12.04 (Precise Pangolin). The same instructions also work with the 11 inch 4th Generation MacBookAir (release date: July 2011). If you have a different model, please go here and find the right wiki.

If for some reason you want to install Ubuntu 11.10 (Oneiric Ocelot), see the previous version of this page for details. Ubuntu 12.04 LTS needs much less configuration than 11.10 as many issues have already been solved, so it's recommended to install 12.04 LTS rather than 11.10.

Overview

Anything not mentioned here should work out of the box. If not, please refer to the Ubuntu Apple Users forum.

IconsPage/ok.png (works out-of-the-box) IconsPage/ok.png IconsPage/info.png (works, with remarks) IconsPage/warning.png (needs manual install) IconsPage/dont.png (won't currently work (completely)) IconsPage/question.png (not yet documented)

Basic Installation Instructions

General instructions for installing and maintaining Ubuntu on Intel-based Macs are found in the Intel CPU-based Macintosh Generic Installation Instructions. Note that a few differences exist for this particular model:

  • You should use Ubuntu 12.04 64-bit: ubuntu-12.04.2-desktop-amd64+mac.iso (mirror)

  • The MacBookAir4,2 is preinstalled with OS X Lion, and it is impossible to use the Lion version of Bootcamp to create space for installing Ubuntu. Follow the alternate instructions using DiskUtility instead:

    • Install refit, then reboot to OS X again

    • Start Disk Utility (in the Utilities folder inside the main Applications folder) and repartition OS X to your liking, set the remaining to msdos (fat).

  • The MacBookAir4,2 has no CD/DVD drive, and cannot start Ubuntu from a USB stick created using the standard tools. However, a script is available that will create a suitable USB image - do not believe the opinion widely expressed on other websites that it is necessary to purchase an Apple Superdrive. Note that lines 21 and 22 of the script need to be edited in accordance with the adjacent comments, and the script uses 'aptitude', so you should either install that, or change the one occurrence to use 'apt-get' instead; the script must be run from within Ubuntu and will not work under OS X, so you'll need another PC with Ubuntu (possibly running from a Live CD or Live USB image) to complete the task; and the script will not work on Ubuntu 10.04 Lucid Lynx. Once the script has been edited, it must be made executable and executed with root privileges:

cd [path to script]
chmod a+x setup_mac_usb_boot.sh
sudo ./setup_mac_usb_boot.sh
  • To boot from the Live USB, restart the machine with ALT held down. Do not install immediately: first use gparted to manually set up the partitions. First delete the msdos partition you have created before using DiskUtility. Then create at least 3 partitions: boot partition (which will be used only for Grub - 1 MB ext2 is enough), linux partition (I chose ext4), swap partition. Set the flag bios_grub on the small boot partition. Then close gparted and start the installer. Choose manual partitioning. It is Important to set the bootloader to install to the small bios_grub partition. It does not need to be mounted as /boot, nor touched in any other way.

  • Once installation finishes, reboot, launch the refit shell and hit 'y' to resync the partition tables, then power down from refit.
  • Some (but not all) users have reported post-installation problems with the Master Boot Record (MBR). If you get "No Operating System Found" or a black screen after choosing Linux from the rEFIt menu (and you tried rEFIt's resync), you'll need to install GPT fdisk (aka gdisk) (you can do this from MacOS or from the live session). Once you have gdisk follow these steps.

  • After installing, download the post-install-precise.sh script. To run the script, it's necessary to first make it executable, and then to execute it as root:

cd [path to folder containing script]
chmod a+x post-install-precise.sh
./post-install-precise.sh

The script will update some configuration settings recommended to allow the MacBookAir4,2 to function fully under Ubuntu 12.04.


Further instructions

This page is a work in progress, and outlines the steps that a reasonably knowledgeable user would use to install Ubuntu on a MacBookAir4,2. If you encounter difficulties, you can find further information and ask questions in the Ubuntu MacbookAir4 Thread.

The relevant code snippets from post-install-precise.sh script are embedded into this wiki page on a per-task basis, so you can copy and paste one snippet at a time, so you know exactly what changes are being made. Just running the script --although convenient-- is potentially too much of a black box for many users.

LCD Panel

Does work out of the box.

Suspend, Hibernate, Shut-down and Reboot

All except hibernate work perfectly with no need for post-installation changes.

To fix the hibernate problem, you need to add the resume parameter with the correct swap partition to the kernel boot options. For example, in my case, swap is at /dev/sda5 so I edited /etc/default/grub as follows:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.i915_enable_rc6=1 resume=/dev/sda5"

after making this change, run 'sudo update-grub'.

Finally, to enable hibernate follow the steps on this page.

The following change brings back eth0 after suspend when using the apple usb-ethernet adapter:

echo 'SUSPEND_MODULES="asix usbnet"' | sudo tee -a /etc/pm/config.d/ethernet_fix

Keyboard functions (Brightness,volume,...)

In some keyboards, mappings aren't correct (±§~` symbols). With care, all these issues can be fixed using the xmodmap program:

xmodmap ~/.Xmodmap

example xmodmap configs: 1. dfacto 2. pof

Keyboard backlight

Works out of the box.

Touchpad

Works perfectly out of the box.

There are 3 different drivers available for the touchpad:

  • synaptics (used by default on Ubuntu 12.04, when there is no xorg config file): Use the 'Mouse and Touchpad' option in system settings to enable multi-touch scrolling and tap-to-click. To enable 3 finger click, run the following command: synclient TapButton3=2 ClickFinger3=2 PalmDetect=1

  • xf86-input-mtrack: Highly configurable trackpad driver with all features enabled, see xf86-input-mtrack page on github for configuration details.

    • Note that it is also convenient to install dispad, a small daemon for temporarily disabling the trackpad while typing on the keyboard. Configuration file is on '~/.dispad'.

  • touchegg: you can install it just by 'apt-get install touchegg', it works best together with the synaptics xorg driver, although it can work with 'evdev' too. Unfortunately it doesn't work with mtrack. For the advanced gestures to work you need to launch the 'touchegg' daemon. Configuration file is on '~/.config/touchegg/touchegg.conf'.

Wireless

Works perfectly out of the box using either 'wl' (broadcom closed driver) or 'brcmsmac' (open source driver).

If using the default wl driver in Ubuntu 12.04 you'll notice a 30 seconds delay to connect to a wireless network after resuming from suspend, it is recommended to use the updated version (using CFG80211 API) which does not have this timeout, to use the updated version follow these instructions:

$ sudo apt-get purge bcmwl-kernel-source
$ sudo add-apt-repository ppa:poliva/pof
$ sudo apt-get update
$ sudo apt-get install broadcom-sta-dkms
$ echo 'blacklist bcma' |sudo tee -a /etc/modprobe.d/blacklist-bcma.conf

If you want to use the brcmsmac driver, follow these instructions:

$ echo 'blacklist wl' |sudo tee -a /etc/modprobe.d/blacklist-wl.conf
$ echo 'brcmsmac' |sudo tee -a /etc/modules

Please note that the brcmsmac driver is not as good with power management as the wl driver, and will drain your battery faster.

Bluetooth

Works perfectly out of the box.

iSight

Works perfectly out of the box.

Sound

Works perfectly out of the box, but it's switched off by default after installation. Run "sudo alsamixer" command in a terminal. Then select the surround channel and unmute it by pressing "m" and put the volume up.

Microphone

Works perfectly out of the box.

External Monitor

Works perfectly out of the box. Some users have reported problems getting the external monitor to work after resume from a suspend, specially when using compiz (unity 3d). As a workaround, switch to the unity2d interface.

Thunderbolt

Thunderbolt support is not yet available under Linux. This is an area under heavy development and support is likely to be available in future versions of Ubuntu.

SD card slot

Works perfectly out of the box.

Fan Control

Works perfectly out of the box, macfanctld isn't strictly needed but if you want to install it:

        sudo add-apt-repository ppa:mactel-support/ppa
        sudo apt-get update
        sudo apt-get install macfanctld
        sudo service macfanctld stop
        sudo sed -i "s/\(^exclude:\).*\$/\\1 13 14 15/" /etc/macfanctl.conf
        sudo service macfanctld start

HFS+ (OS X disc partition)

Works perfectly out of the box.

Sensors (temps & fans)

Works by default however to (optionally) read the sensor data requires the package lm-sensors which is installed by post-install-precise.sh.

sudo aptitude install lm-sensors
sudo tee -a /etc/modules <<-EOF
        coretemp
        hid_apple
EOF

GPU Power Save

The post-install script, post-install-precise.sh, adds a boot parameter to grub, which allows the GPU to enter a low power state when it is idle. This option offers a considerable power reduction of 26%, according to an article at Phoronix.

sudo cp /etc/default/grub /etc/default/grub.$(date +%Y-%M-%d)
sudo sed -i "s/\(GRUB_CMDLINE_LINUX_DEFAULT=\).*\$/\\1\"quiet splash i915.i915_enable_rc6=1\"/" /etc/default/grub
sudo update-grub

Other Power Saving tips

To enable power management for USB/PCI/SATA devices when on battery:

wget http://pof.eslack.org/archives/files/99_macbookair
sudo mv 99_macbookair /etc/pm/power.d/99_macbookair
sudo chmod 755 /etc/pm/power.d/99_macbookair

If you don't use bluetooth regularly you can disable it by default at boot time. You can enable it manually later by clicking on the top panel bluetooth icon if you need to use bluetooth:

sudo sed -i '$i /usr/sbin/rfkill block bluetooth' /etc/rc.local

If you want to enable automatic keyboard brightness level and automatic LCD backlight level based on the ambient light sensor, you can install lightum:

sudo add-apt-repository ppa:poliva/lightum-mba
sudo apt-get update
sudo apt-get install lightum

Configuration file is on '~/.config/lightum/lightum.conf'.


CategoryMac

MacBookAir4-2 (last edited 2013-12-14 02:16:55 by knome)