Wednesday, 9 July 2014

How to install Linux Mint alongside OSX on the MacBook Air

Posted by Gary Newell  |  at  13:27 27 comments

Introduction


In previous articles I have shown how to install Ubuntu Linux alongside Windows 8 and how to dual boot Ubuntu with ChromeOS on the HP Chromebook.

This time I am going to show how to install Linux Mint alongside OSX on the MacBook Air.

Linux Mint has been top of the Distrowatch rankings for the past year. Whilst the rankings have to be taken with a pinch of salt there is clearly merit in writing an article showing the best that Linux has to offer working on hardware that oozes quality.

The actual installation isn't too difficult but there are some challenges on the way and the steps highlighted are the steps I used to complete the task. As always if there are better ways to achieve the same goals please feel free to leave a comment.

What you will need

  • A MacBook Air - If you don't have a MacBook Air you can pick one up from here.
  • A USB drive
  • Time and patience
Optionally you might look into purchasing an Apple USB Ethernet cable as it will help when setting up the internet.

Back up your drive

The first and most important step you can take before undertaking any of these steps is to back up your drive.

One thing I really like about the MacBook Air is the fact that if you completely destroy your operating system it is always possible to get back to a point where the computer is working again. The chances of you turning your MacBook Air into an expensive brick are highly unlikely.

If you have been using your MacBook Air for some time you will probably have accumulated some data and you will have installed some applications which you probably want to keep.

Therefore before we start partitioning drives and changing boot settings let's look at backing up what you have.

The MacBook Air that I am using is new and therefore I don't have much installed. The size of the recovery drive is showing as 16.7 gigabytes.

On a fairly vanilla system you could therefore get away with backing up to a 32 gigabyte USB drive. If you have lots of data then you might need a bigger USB drive or an external hard drive which is what I used for the task.






Insert a blank USB drive or external hard drive into your MacBook Air. A message will be displayed asking whether you want to use it as a recovery drive.

Click the "Use as Backup Disk" option.



A message will now appear asking whether you are sure you want to use the external drive as a backup disk.

If you are sure click "Erase".

Note: All data on that drive will be deleted so make sure you use a blank drive



The "Time Machine" software will now start backing up your system to the external drive.

Note: You can also run the "Time Machine" software from the "Applications" menu and you can then choose the drive you want to backup to.

Download Linux Mint

The current version of Linux Mint is version 17 and this is the long term support release with 5 years of support.

If you are looking for stability for your computer then Linux Mint 17 is definitely a good choice.

To find out more about Linux Mint visit http://www.linuxmint.com/.

To download Linux Mint 17 visit http://www.linuxmint.com/download.php



There are a number of different download options available. The version I installed was the Cinnamon 64-bit edition.

Cinnamon provides a modern take on the traditional desktop. What you end up with is something familiar looking but very stylish.

The MATE, KDE and Xfce editions will all work equally as well but you should always pick the 64-bit version and there is no merit in going for the no codecs versions.

Create a Linux Mint USB drive


In order to install Linux Mint you will need to create a bootable Linux Mint USB drive.

Insert the USB drive into one of the available slots in the MacBook Air.

The tool I used for this job is called the Mac Linux USB Loader.

Click here to download the Mac Linux USB Loader.


When you run the Mac Linux USB Builder a message appears stating that you need to install Java. (Unless you have already installed Java previously).

To install Java click "Install".



A license agreement will appear and you must click "agree" to continue.


Click the "Create Live USB" button. You will then be shown a window which enables you to find the Linux Mint ISO downloaded in the previous step. Click on the "Downloads" option in the left pane and then select the Linux Mint 17 ISO.


Now all you have to do is click on the "Make Live USB" button.



A progress bar will appear and a message will appear stating that the USB drive has been created.


Partition the drive

Normally the disk partitioning is the trickiest part when it comes to dual booting.

The disk utility within OSx makes the task incredibly easy.

To run the disk utility click "Go" from the menu and select "Utilities" and then click on the "Disk Utility" icon.





The "Disk Utility" shows the states of each drive and can be used to create recovery partitions, erase disks and restore partitions.

As you can see from the image above I have three disks. One is the Apple SSD drive which comes with the MacBook Air. I also have the 8 GB USB drive which now has Linux Mint on it and another 8 GB USB drive used for storing the images for this article.

To create a partition for Linux Mint on the Apple SSD all you have to do is select the drive and click the "+" symbol under the disk layout.





The disk will be split right down the middle. You can adjust the new partition by increasing or decreasing the size.

You should format the disk to "Free Space".

Once you have the disks looking as you want them to click "Apply".


A warning message is displayed and if you are unsure as to whether you want to go ahead then you should click cancel.

If you are happy to continue click "Partition".

The partitioning process takes a little while to complete.

Booting into Linux Mint Live

To boot into the live version of Linux Mint reboot your computer and hold down the "Alt" key.

















When the computer boots you will have an image similar to the one above. The number of icons will depend on the bootable devices available.

Click on the drive that represents your USB drive. Which one is that? In theory if you have just the Macintosh HD (The Apple SSD) and your USB drive you need to click on the drive that isn't the "Macintosh HD".





















Install Linux Mint

When the Linux Mint Live USB boots into Linux Mint you will see an icon on the desktop called "Install Linux Mint". Click on this icon.


The installation is now fairly standard. Click the language to be used for installation purposes. If you feel like a challenge try Welsh (Cymraeg) otherwise I would select the one you are most comfortable with.

The next screen shows you how prepared you are for installing Linux Mint.

It is a good idea to have the MacBook Air plugged in during the installation and you must have at least 8.6 gigabytes of disk space. The internet connection is optional and for reasons I will explain later quite tricky to achieve.

Click "Continue".























You are now given the option of replacing OSX or installing alongside it.

Normally I recommend choosing the something else option and creating separate root, home and swap partitions but as Linux Mint 17 is going to be around for 5 years I chose the "Install Linux Mint alongside Mac OS X" option.

Click on "Install Now" to continue.























In the next step choose your location by clicking in the appropriate position on the map.

Click "Continue".























Almost there now.

Choose your keyboard layout from the list and then click "Continue".























Enter your name, pick a username and enter a strong password.

Note that the computer name has junk in it so change the computer's name to something more meaningful.

Click "Continue".



























The files will now be copied to your MacBook and once the process has finished a message will be displayed saying you can now reboot your computer.





Click "Continue Testing" as there is a little bit more work to be done.

Fix the boot loader

If you restart your computer without following these steps then you will boot straight into OSX.

To fix the boot order open up a terminal window. You can do this by clicking the 4th icon from the left in the panel at the bottom of Linux Mint. (Black background with >_).

Type the following commands:

sudo apt-get install efibootmgr
sudo efibootmgr


As you can see from the image above my MacBook Air is going to boot 0000 first and then 0080.

The labelling of the disks is shown underneath. Boot0000 is Ubuntu and Boot0080 is OSX.

Note that it says Ubuntu and not Linux Mint but it means the same thing.

If the boot order shows Ubuntu as 2nd in the boot order you need to run a command to put it in 1st position.

sudo efibootmgr -o 0,80

The above command will put boot0000 first and boot0080 second. If your disks are the opposite way round then you will need to switch the 0,80.

Now when you reboot your MacBook a menu will appear with options to boot Linux Mint and OSX.

If you choose Linux Mint then it will work perfectly fine but if you choose OSX it will fail.

You can boot into OSX by pressing the escape key at the menu and then type "exit". This is not the best solution though and the next part of this guide will provide a slightly better one.

Fix the Grub boot menu

From within Linux Mint (not the live version, the installed version) open up the terminal window again (4th icon from left on the bottom panel).

Type the following:

sudo nano /etc/grub.d/40_custom

When the editor opens enter the following lines at the bottom:

menuentry "Exit to Mac OSX" { exit }
 
Press CTRL and O to save the file and then CTRL and X to exit the file.

Now run the following command:

sudo update-grub

Reboot your computer and you should now have a new menu option called "Exit to Mac OSX". If you want to use Mac OSX select this option.

Connecting to the internet

Connecting to the internet is usually incredibly easy but the MacBook Air uses Broadcom for connecting wirelessly and this has always caused issues for Linux.

I have read a number of guides for resolving this issue and none of them worked for me, so here is the way I did it.

The main issue is that to connect to the internet you need to install the Broadcom driver but to install the Broadcom driver you need an internet connection.

Normally you could get around this by connecting your computer via an ethernet cable but the MacBook Air doesn't have an ethernet port.

You can get around this issue by spending £25 at your local Apple Store.

All you have to do then is connect USB cable in to the MacBook Air and an ethernet cable from your MacBook to your router. You are then able to install the correct drivers by using the driver manager within Linux Mint.






 
There is another way though that costs no money at all which is the method I used.

The required Broadcom drivers are available from the Linux Mint ISO downloaded earlier and so by loading the ISO as a CDRom it is possible to install them. 

First of all boot into Mac OSX and then copy the Linux Mint ISO to a USB drive (just copy the ISO, don't use the loader).

Reboot into Linux Mint and copy the ISO from the USB drive to your home folder. 

To do this click the file manager icon which is available on the bottom panel (5 from the left, looks like a folder).

Click on your USB drive and then drag the ISO to the "Home" folder.

Click on the "Menu", select "Administration" and then "Software Sources".



Click on the "Additional Repositories" tab and then click in the CDRom box. 

Close the "Software Sources" icon and then open up a terminal window.

Type the following lines into the terminal window:

sudo mkdir /media/cdrom
cd ~
sudo mount -o loop linuxmint-17-cinnamon-64bit-v2.iso /media/cdrom 

Finally, open up the driver manager by clicking "Menu -> Administration -> Driver Manager".


Ignore the warning. 

Click "OK" and then select the "bcmwl-kernel-source" radio button.

Click "Apply Changes".

If everything goes well you should now be able to click the network icon in the system tray and a list of wireless networks should appear.





















Summary

The biggest challenge to installing Linux Mint 17 on a MacBook Air is trying to get the wireless working.

I have tested many of the other features of the MacBook and most things seem to work well such as audio, the trackpad, recovering from sleep mode etc.

If you have found any issues whilst following this guide leave a message in the comments section and I will try to help solve them.
 
Thankyou for reading.

27 comments:

  1. thanks for the tutorial, I run debian on my 15" macbookpro so it is pretty similar.
    what do you do about using the webcam on linux?

    ReplyDelete
  2. I can't understand what is the boot loader switch. To boot with Mac or Linux Mint 17 how can choose the Operating System? Many tutorials suggest 'Refind' but in this guide no extra boot loaders are mentioned. Please, publish a screenshot that show Your OS's switching method. Probably whit this tutorial You are able to switch OS from Mac System preferences-->Startup disk-->select the system you want to use to startup your computer mac-->restart/reboot, something like this example http://goo.gl/2wcXlo Or maybe, each time I need to switch I need to start with 'ALT' key pressed and leave it when a list of bootable disks/media appears like this example? http://glandium.org/blog/?p=2830 Honestly I am very interested on Your solution and if the boot OS' switching is affordable after shown pics or video that it works, I'll be very happy to thank You. Thank for reading, Andrea

    ReplyDelete
    Replies
    1. Linux Mint does not work on the Macbook air. Linux Mint 17.1 does not support the Macbook air's grahic drivers. I am going to see if updating to the 3.16 linux kernal will have some new drivers.

      Delete
    2. I've installed Linux Mint on a first-generation MacBook Air (MacBookAir1,1), and seems to be working fine. The only problem I've had is the lack of a WiFi driver. Haven't tried the solution above yet, but I definitely will.

      Delete
  3. This is exactly what I have been looking for for hours, thank you so very much!

    ReplyDelete
  4. Thanks! Your wireless driver instructions worked perfectly on my macbook pro retina.

    I like to test linux every few years. Mint seems cool. But screen text was rendered so poorly! And the trackpad wasn't very responsive (even after I adjusted the trackpad settings).

    ReplyDelete
  5. I am finding Grub won't display when starting. Any suggestions on how to fix this? Thanks!

    ReplyDelete
    Replies
    1. For me the problem is there is no 5 sec timeout so it boots directly in to Mint. If I boot with the down arrow pressed it works fine.

      Delete
    2. Also that doesnt work for me any tips even before addig those lines to the grub file it rebooted straight in mint withouy grub

      Delete
  6. I'm surprised this worked for you. I'm on a MBA as well and came to find, through trial and error, that the video drivers won't work right in EFI; that you have to install grub-pc in order to boot in bios for nvidia driver compatibility. I was not able to get through a USB install procedure at all but am going to try a DVD-based approach using the apple superdrive, as pc-grub is default on the .iso.

    ReplyDelete
  7. It doesn't detect OS X in the Linux Mint installer?

    ReplyDelete
    Replies
    1. me too. Mint installer does not find OS X, although the disk manager can see the partition. It just does not recognize it as OS X.

      Delete
    2. That is odd. Is your OSX encrypted in any way?

      Delete
    3. Same problem for me. I don't think my OS X disk is encrypted.

      Delete
    4. Sorry for a late reply! This is probably because you could be running a beta OS X, or the installer just doesn't recognise the version as it could have come out later.

      You can select a partition under the "custom" tab to install under, and also select a swap partition. The install will continue.

      Also for a boot loader, just use rEFIt, or rEFInd (the newer version). Works a treat.

      Delete
  8. I installed linux mint as the only OS in my macair but I'm not able to set the boot loader. Can anyone help?

    ReplyDelete
  9. I used the same tutorial to install Ubuntu trusty (14.04). Everything worked perfectly, even the wireless worked without the need to install drivers. It didn't work during "try Ubuntu" phase, but worked after reboot.
    Thanks for the extensive tutorial.

    ReplyDelete
  10. helo, nice instructions but could any body help me with one little thing: i have Refit installed on MACOSX if i follow the instruction to reorder the reboot, will the refit work and inicater with refit or its better to unistall Refit. Thank you and sorry for my English, ím Portuguese

    ReplyDelete
  11. After booting the USB, I got a couple of questions/options, then kernel panic. Hmmm.

    ReplyDelete
    Replies
    1. Hi Philip,

      Are you running this guide on a Macbook Air? This guide is specifically for that device.

      The most common other cause for a kernel panic is a corrupt USB drive or maybe the ISO image didn't download correctly.

      Hope this helps

      Delete
  12. Have a little problem here. Last Saturday I installed Mint on my iMac (13.1), all good. The problem is when I boot Mac OS, screen start flashing black (sometimes once every 10 minutes, sometimes every 4 seconds or even go completely black).

    The computer continue to work no problem, just the screen have the problem. Can't be a hardware problem, because it never happened before. I tried to restore backups, then a clear Yosemite install. Still, no good.

    Do you know what might be the problem (and how to get it fixed)?

    Thanks!

    ReplyDelete
  13. I accedently did the grub fix thing in continue testing mode and now i cant boot into linux even when holding alt only macintonish hd pops up when in os x in disk itilty i can see the disk though

    ReplyDelete
  14. Hi Gary, I follows your grub tutorial for installing Debian. It worked fine, everything was working until today (after I applied a security update from the appstore), it now boots directy to OSX, holding alt for booting to linux only shows me the OSX partition. Any clue of what I can do?

    ReplyDelete
    Replies
    1. That happened to me too after an upgrade. I fixed it by booting to a linux live cd and from there I did the "Fix the boot loader" from tutorial.

      Delete
  15. Will these instructions work for an old MacPro 3.1 that is currently running OS X Yosemite 10.10.5? Can skip the wireless bit.

    ReplyDelete
  16. This doesn't work for sh!t. Your images don't match what I'm getting and once i get to the installer it can't find the mac os.

    ReplyDelete
  17. Since Air doesn't have ethernet port, to install wireless drivers, you can use usb tethering on your mobile phone. Works like a charm :)

    ReplyDelete

Feel free to comment on any of the blog posts. Please try to be constructive.

Offensive messages will be removed as will blatant adverts for misleading products and sites.

Thanks for visiting my blog

    Popular Posts



back to top