How to properly install Kali Linux on MacBook Air (dual-boot with El Capitan)

I set up a MacBook Air 2013 from scratch and tried to install Kali Linux 2.0. The install was successful, the big problem is the Broadcom wireless card though. But that's probably a second question.

Here is what I did:

  1. First I made a fresh install of El Capitan 10.11.1 after repartitioning the internal drive to 1 partition with a GUID partition table.
  2. After configuring El Capitan I downloaded Kali Linux and rEFInd 0.9.2
  3. Then I dd'ed the kali iso image to a thumb drive:

    First get the disk identifier of the thumb drive and unmount it:

    diskutil list
    

    My thumb drive had the disk identifier disk2.

    diskutil unmountDisk /dev/disk2
    

    then dd the iso to the thumb drive:

    sudo dd if=/Users/your_user_name/Downloads/kali-linux-2.0-amd64.iso of=/dev/rdisk2 bs=1m
    

    The thumb drive will be bootable without installing rEFInd.

  4. Then I booted to Recovery HD by holding cmdR while booting. Disable System Integrity Protection in Terminal with

    csrutil disable
    
  5. Reboot to Internet Recovery Mode by holding altcmdR.You will see a spinning globe animation while booting.

  6. Since you probably have a CoreStorage partition after installing El Capitan you have to resize it. I doubt that the disk partition tool in the Kali Live USB drive succeeds with that. Open Terminal and enter:

    diskutil cs list
    diskutil cs resizeStack lvUUID size
    

    lvUUID is the UUID of the Logical Volume. It's the last one listed in the output of diskutil cs list. The size has to be in t, g, m or k. Example: If your main disk has 250 GB and you need 40 GB free space to install Kali Linux to, enter 210g.


    If you don't have a CoreStorage stack on your Mac you may choose Disk Utility to resize the main volume. The Recovery HD should be moved automatically in both cases.

  7. Reboot while holding the alt key. Boot to the Windows partition of the thumb drive. Choose Graphical Install and configure the locale settings. The network interface install will probably fail. Choose none. Use the defaults of the disk partitioning tool. It will choose the empty space on your main disk to create a small boot partition for grub, a main partition and a swap partition. Then Kali Linux will be installed. Install grub to the mbr of your main disk.

  8. After a reboot the Mac will boot to OS X. Eject the Kali Linux installer thumb drive.

  9. Install rEFInd:

    cd /Users/your_user_name/Downloads/refind-bin-0.9.2
    ./install.sh
    

    Rename the refind folder and the efi file:

    cd /Volumes/ESP/EFI
    mv refind boot
    mv boot/refind_x64.efi boot/bootx64.efi
    

    Immediately after installing rEFInd the EFI volume is mounted at /Volumes/ESP and the install script fails to unmount it. If you mount disk0s1 later manually (e.g. after a reboot) with diskutil mount /dev/disk0s1 it will be mounted to /Volumes/EFI! Then you have to use cd /Volumes/EFI/EFI instead.

  10. Quit Terminal and reboot while holding alt

  11. Choose EFI Boot at the Mac boot screen and then Kali Linux at rEFInd boot screen.
  12. Set up Kali Linux

Everything except the WLAN interface (and AFAIK the webcam) works now.

To further set up Kali Linux check the following resources:

HOWTO : Kali Linux 1.0.6 on MacBook Air (Mid 2013) 13 inches

To get the Broadcom chip to work check:

How to install Broadcom BCM4360 on debian on Macbook pro
How do I install build-essential without an Internet connection?
Kali 2.0 Installation Tips for Macbook Pro 2015 Retina
Broadcom firmware
Installing Debian On Apple MacBook Air6-2
b43 and b43legacy

Until now I haven't been able to get WLAN working but I'm investigating that and I will extend the answer as soon as I'm successful.


After setting up everything successfully boot to the Recovery HD again and reenable System Integrity Protection in Terminal with

csrutil enable

You have to get the order right first.

1) Download rEFInd and UNetbootin

2) Reboot while holding the Option key upon boot

3) Go into Recovery HD and create a partition for Kali

4) Open Terminal and type: csrutil disable

5) Reboot then use UNetbootin to 'burn' the ISO onto your USB

6) Reboot with USB plugged in and holding the Option key upon boot

7) At the rEFInd screen you will have the choice to boot from the USB

8) Boot from the USB and install Kali as normal

As for your issue with WiFi, here's a simple fix. Here is a page from a wiki for Arch but it is the same for Kali as well. Since Kali is Debian-based, use the broadcom-wl and not the broadcom-wl-dkms as the driver.

Then there's the webcam thing. There's a driver hidden in the OS X partition at:

/System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns/AppleUSBVideoSupport.kext/Contents/MacOS/AppleUSBVideoSupport

These one, two and three sites all give detailed instructions about how to extract and load the driver for the iSight camera. If you're looking through the firmware and still can't find the right one, check this or this site.