Linux Mac

How to Install and Dual Boot Linux on Your Mac

Dan Helyer Updated 06-12-2019

Whether you need a customizable operating system or a better environment for software development, you can get it by installing Linux on your Mac. Linux is incredibly versatile (it’s used to run everything from smartphones to supercomputers), and you can install it on your MacBook Pro, iMac, or even your Mac mini.

Advertisement

Apple adding Boot Camp to macOS made it easy for people to dual boot Windows, but installing Linux is another matter entirely. Follow the steps below to learn how to do this.

Why Install Linux on a Mac or MacBook Pro?

Your Mac offers excellent performance, superb battery life, and long durability. The hardware on a Mac is difficult to match, which makes it an incredibly powerful machine for running Linux.

What’s more, Linux breathes life into old Macs that are no longer eligible for macOS updates. Rather than letting your old MacBook Pro turn into an expensive paperweight, install the latest version of Linux and keep it going for years to come.

Ubuntu Is Our Linux Distribution of Choice

There are many different versions of Linux available, but for the purposes of this tutorial, we suggest installing Ubuntu on your Mac. Ubuntu is the most popular Linux distribution, which means there are lots of active support communities available if you ever need help.

We even wrote an extensive beginner’s guide to Ubuntu Ubuntu: A Beginner's Guide Curious about Ubuntu, but not sure where to start? Everything you could possibly need to get started with the latest version of Ubuntu is right here, written in easy-to-understand, plain English. Read More you can use to get started with it.

Advertisement

To Dual Boot or Not to Dual Boot

With a dual boot system, both macOS and Linux are installed on your Mac. Hold Option while your computer boots up to choose which operating system to use. The main difference between a dual boot system and a virtual machine Dual Boot vs. Virtual Machine: Which One Is Right for You? If you want to run multiple operating systems on one machine, you can either dual boot or use a virtual machine. But which option is better for your case? Read More is that you can only use one OS at a time while dual-booting, but you get better performance.

If you don’t plan to ever use macOS again, you might want to completely replace it with Linux instead. That way, none of your storage is used up by its system files.

However, if you ever change your mind, it’s difficult and time-consuming to restore macOS again in the future. This is especially true since Linux writes over the macOS Recovery partition.

For that reason, we recommend you dual boot Linux on your Mac. If you’re really certain you don’t want to do that, just skip the Partition step in the instructions below.

Advertisement

Step 1: Prepare Your Mac for Installing Linux

To install Linux on your Mac, you need a USB flash drive with at least 2GB of storage. You’ll erase the flash drive in a future step to put an Ubuntu installer on it, so make sure you’ve backed up any important files first.

Use an Ethernet adapter to connect your Mac to the internet. This is important, because your Wi-Fi may not work in Ubuntu without third-party drivers. Similarly, iMac users should get hold of a USB keyboard or mouse, in case Bluetooth doesn’t work.

If you plan to dual boot your Mac with Linux, you also need to make sure you have enough free storage. Go to Apple menu > About This Mac > Storage to check that you have at least 25GB free (but preferably more).

Mac Storage info

Advertisement

Finally, make a backup of your Mac. You shouldn’t lose any data by installing Linux in a dual boot partition. However, if something goes wrong, you may need to erase your entire Mac to fix it.

If you plan to replace macOS with Linux, rather than creating a dual-boot system, use Carbon Copy Cloner to back up your macOS Recovery partition How to Delete (or Restore) Your Mac's Recovery Partition Here's how to delete the Recovery partition on your Mac if necessary, plus the process of restoring the Recovery partition. Read More . This makes it far easier to revert back to macOS again in the future.

Step 2: Create a Partition on Your Mac Drive

Disk Utility window showing Linux and Swap partitions for Dual Boot on Mac

For a dual boot system (which we strongly recommend), you need to create a Linux partition on your Mac’s hard drive. If you don’t want to create a dual boot system, skip ahead to the next step.

Advertisement

In fact, to dual boot Linux on a Mac, you need two extra partitions: one for Linux and a second for swap space. The swap partition must be as big as the amount of RAM your Mac has. Check this by going to Apple menu > About This Mac.

Use Disk Utility to create new partitions on your Mac:

  1. Open Disk Utility from the Utilities folder in your Applications, or search for it via Spotlight.
  2. In the top-left corner, select View > Show All Devices.
  3. Select the highest-level drive for your Mac hard disk, then click Partition.
  4. Use the Plus button to create a new partition. Name it UBUNTU and set the format to MS-DOS (FAT). Give it as much space as you want to use for Linux.Ubuntu partition information in Disk Utility
  5. Click Apply to create the partition.
  6. Repeat the steps above to create another partition. Name this partition SWAP and set the format to MS-DOS (FAT) again. Make the size match the amount of RAM in your Mac. This might be 4GB or 8GB, for instance.
  7. Click Apply to create the partition.

If you can’t create new partitions, it could be because FileVault is encrypting your hard drive. Go to System Preferences > Security & Privacy > FileVault to turn it off.

Install rEFInd for Better Boot Options

Boot EFI option from rEFInd boot manager

The standard boot manager on your Mac doesn’t always work with Ubuntu. This means you need to install a third-party boot manager instead, which will let you easily choose between macOS or Linux when you start up your computer.

Thus, your next step is to download rEFInd, which is the boot manager we recommend. To install rEFInd, you need to temporarily disable System Integrity Protection How to Disable System Integrity Protection (and Why You Shouldn't) There are more reasons to leave macOS' System Integrity Protection on than turn it off, but turning it off is easy. Read More . This is an important security feature for macOS, so make sure you enable it again afterward.

To install the rEFInd boot manager:

  1. With SIP disabled, open Terminal from the Utilities folder in Applications (or search for it using Spotlight).
  2. Open Finder in a separate window and navigate to the rEFInd download.
  3. Drag the refind-install file into your Terminal window and press Enter.
  4. When prompted, enter your administrator password and press Enter again.
  5. After the installation, remember to enable SIP again.

Dropping refind-install file into Terminal window, with the code that appears

Next time you restart your Mac, the rEFInd menu should appear automatically. If it doesn’t, hold Option while booting up to load your boot manager.

Step 3: Create an Ubuntu USB Installer

Download the latest version of Ubuntu as a disk image from the Ubuntu website. You need to use a third-party app to create a USB installer from the Ubuntu disk image. One of the simplest apps for this is balenaEtcher, but you can use anything you like.

To create an Ubuntu USB installer:

  1. Open balenaEtcher and click Select Image.
  2. Navigate to the Ubuntu disk image you downloaded and click Open.
  3. Insert your USB flash drive and balenaEtcher should automatically select it. If it doesn’t, click Select Target or Change to select the flash drive yourself.
  4. Make sure the correct drive is selected, since the next step erases it.
  5. Click Flash and enter your administrator password to erase the USB flash drive and create an Ubuntu USB installer.
  6. When it’s finished, macOS prompts you to Eject the flash drive.

balenaEtcher window ready to create an Ubuntu USB installer

Step 4: Boot Ubuntu From Your USB Installer

Restart your Mac while holding Option and reinsert the USB flash drive directly into your computer. When the boot loader appears, use the arrow keys to select the Boot EFI option and hit Enter.

An Ubuntu loading screen appears, followed by the Ubuntu desktop.

Ubuntu desktop showing Install Ubuntu disk image

Use this opportunity to test Ubuntu on your Mac. Keep in mind that because it’s running from your USB flash drive, it may be slow. Since Ubuntu can’t use your Mac’s Wi-Fi by default, use an Ethernet adapter to connect to the internet.

Disable Secure Boot on Macs With the T2 Security Chip

In 2018, Apple introduced the T2 security chip to new Macs. This advancement might stop you from booting other operating systems on your machine. If you experience any boot issues, follow Apple’s instructions to disable the T2 chip.

Step 5: Install Ubuntu on Your Mac

When you’re ready, double-click the Install Ubuntu item on the desktop.

Follow the on-screen prompts to choose your language and keyboard layout. Choose a Normal installation and select the option to Install third-party software. You need to connect your Mac to the internet using an Ethernet cable to install this software, which makes functions like Wi-Fi and Bluetooth work. Then click Continue.

Normal Ubuntu installation with third-party software selected

If prompted, choose to keep your partitions mounted.

Option 1: Dual Boot Ubuntu With macOS

From the Installation type screen, select Something Else and click Continue.

On the next screen, you need to identify and select the UBUNTU partition you created. Unfortunately, there are no recognizable partition names, so look for a device with fat32 in the name that matches the partition size, measured in MB.

Ubuntu Installation Type window selecting fat32 partitions

Double-click to select it and choose Use as: Ext4 journaling file system. Set the Mount point to / and check the box to Format the partition. Click OK. In the popup alert, click Continue to write previous changes to the disk.

Now identify your SWAP partition, which should also have fat32 in the name. Double-click it and choose to Use as: swap area, then click OK.

Open the Device for boot loader installation dropdown menu and select your UBUNTU partition again. The name should match what you selected for it from the table above.

Take a moment to ensure you selected the correct partitions, then click Install Now. Click Continue in the popup alert to confirm you want to write changes to those disks.

Finally, follow the on-screen prompts to choose your time zone and create a user account, then wait for the installation to complete.

Option 2: Replace macOS With Ubuntu

From the Installation type screen, select Erase disk and install Ubuntu.

Be warned: this erases everything from your Mac, including the operating system and the Recovery partition!

Erase disk and install Ubuntu option

When you’re ready, click Install Now and select your hard disk.

Follow the on-screen prompts to set the correct time zone and create a user account, then wait for the installation to complete.

Make Using Linux on Mac Even Easier

Congratulations! You successfully installed Linux on your MacBook Pro, iMac, or Mac mini! If you chose to dual boot Linux on your Mac, hold Option while booting up to choose between macOS and Ubuntu.

Next, take a look at some tips to make your switch from macOS to Linux easier Switching From Mac to Linux? 5 Tips to Make Your Life Easier Switching from macOS to Linux? It might not be as difficult as you think. Try these tips to get an instant Mac feel in Linux. Read More . By adding some familiar macOS features to Ubuntu, you’ll make the most of Linux on your Mac in no time!

Explore more about: Disk Partition, Dual Boot, Linux Tips, Mac Tips, Ubuntu.

Whatsapp Pinterest

Enjoyed this article? Stay informed by joining our newsletter!

Enter your Email

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. linuxmint 18.3
    December 31, 2017 at 3:56 am

    The installation process presented is also very similar to linuxmint 18.3. Works great on a macbook pro retina mid 2015. I did not buy the macbook pro for the OS X but for the retina display experience. If other laptop manufacturers sell laptops with higher resolution display, linux users won't be buying from apple. The hardware combination is just another reason but lately I would say quality of the battery (it is bloated now less than two years use - never happened on non apple laptops) sucks as well as apple representatives the moment your warranty (90 days) expires. The OS X is only there to try on applications that works on windows and OS X but does not have a version for linux. My primary use of the macbook pro is on linux most of the time, processing photographs, watching videos and doing online transactions. I can't trust OS X for online use similar to windows, they do things they are not supposed to do. Computers should work the way how you wanted them to work, not the other way around. With linux, you're the Boss!

  2. RDC4
    November 13, 2017 at 11:06 am

    Hi, I installed linux correctly but this is how it looks like, although I have changed the scale to 1,5. Everything else seems good but explorer text and sizes do not look right, and Codeblocks icons looks very small too. How can I fix this?

    • trip
      January 9, 2019 at 8:28 pm

      you can try Universal access > toggle Large Text

  3. Miguel
    November 7, 2016 at 12:48 am

    Hello! I went through the guide, but I realized I made a number of mistakes:
    (1) I chose to "Install Ubuntu" instead of "Try Ubuntu" and restarted without making the EFI Boot Fix. But I did go through the rest of the terminal tweaks after restarting into Ubuntu.
    (2) I mistakenly changed /dev/sda3 instead of /dev/sda 1 at the Installer stage by recognizing it as an EFI boot partition.
    Now when I restart and hold the option key, I see a volume called "Windows" which when I press, shows "Missing Operating System"
    Is there any way to fix this? Thank you very much in advance!

  4. Piko
    June 9, 2016 at 8:15 pm

    I installed CentOS 7 and for grub to work I had to do next:
    1. find uuid of Mac OS X partition
    > grub2-probe -t fs_uuid -d /dev/sda2
    8724f0f55d4baab1

    2. edit /etc/grub.d/40_custom and add following ... root uuid
    menuentry "Mac OS X" {
    insmod hfsplus
    insmod chain
    search --fs-uuid --no-floppy --set=root 8724f0f55d4baab1
    chainloader (${root})/System/Library/CoreServices/boot.efi
    }

    3. rebuild grub menu
    grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg

    and afther that I can boot to OS X from grub

  5. Roman
    January 20, 2016 at 1:52 pm

    Tried just to boot ubuntu on MacBook Pro Retina (2015) and realised that "Fn" key doesn't work. Can't change sound volume, display brightness, etc from keyboard. Is there a way to fix it?

  6. Othmane kozy
    January 10, 2016 at 10:00 pm

    hello there,

    I followed all the steps, Ubuntu is working very well but i have a problem when starting my Mac, it starts automatically to ubuntu, and when i press the alt while starting I can only choose Macintoch and not ubuntu. What i want to do is that goes directly to Macintoch and then by pressing alt I could choose Ubuntu.

    thank you in advance.

    • Jonathan
      February 16, 2016 at 4:53 pm

      I really want what you have asked for - whats the code to change the EFI boot back to where it was please? I only occasionally use Linux and so want it to natively boot into OSX... VERY FRUSTRATING!

      • Denis
        March 6, 2016 at 10:08 pm

        Me too! Did you find out how to do that?

      • Gabriel
        June 7, 2016 at 10:25 am

        sudo efibootmgr

        find out which number code is OSX

        sudo efibootmgr -o (and the OSX numbercode)

        • Gabriel
          June 7, 2016 at 10:28 am

          for the alt key ..... try reinstalling grub to an empty partition that is after the partition table of the osx installation.
          OSX bootmgr might pick that up

    • ari
      August 31, 2016 at 9:28 am

      when boot, press alt (option) button for few seconds. then choose boot disk.

  7. Ben
    November 28, 2015 at 3:40 pm

    Why are their two EFI things to boot from when you insert the USB?

  8. Anonymous
    October 20, 2015 at 3:28 pm

    Fantastic article, worked almost perfectly with my Macbook Pro 5,5 on which OSX El Capitan was preinstalled.

    Just a few notes:

    To get my Wifi (Airport) working I had to install "B43 firmware" as described here: http://askubuntu.com/questions/470153/no-wireless-when-install-14-04-on-macbook-pro

    When I want to boot into OSX (instead of into Ubuntu, which is the default), I simply hold the "Option" (Alt) key while booting my Macbook. I can then boot into OSX.

    (I suppose this is also possible via the Grub menu but I didn't bother configuring that, the "Option key" trick works fine)

    And finally (because I hate Unity), I install Gnome Classic (see e.g. http://www.webupd8.org/2014/04/how-to-install-and-tweak-gnome.html), and I do a lot of other customizations to make the system "my own".

  9. Frederic
    May 20, 2015 at 5:34 am

    I have tried both Ubuntu and Linus Mint 17, and I must admit that Mint has done a really good job at supporting HDI screens. Definitely recommend it if you want a better user experience.

  10. farhaan
    April 15, 2015 at 1:02 am

    I recently try to dual boot my macbook pro with ubuntu , I used REFIend for boot manager , now whenever I click on the Linux icon a blank screen occurs . Help Needed please

    • Bb
      May 8, 2015 at 2:34 pm

      Hi farhaan, I have exactly the same problem. Grub does not show up. All I get is blank screen. You found a solution by any chance ?

    • farhaan
      May 8, 2015 at 5:37 pm

      Yeah I have solved the problem It is most probably because you are not mounting bootladder on the right partition

  11. titi
    February 16, 2015 at 6:59 pm

    Sorry but... Mint is the most popular distro ! (and not commercial...)
    And you should install mate or cinamon desktop...
    Is all Macbook pro hardware well supported in Linux ? (Macos X is really bullshit...)

  12. Raphael Merx
    February 16, 2015 at 1:59 am

    Thanks for the great write up!

    Any known complications when hard drive encryption with FileVault is turned on?

  13. Nathaniel
    February 14, 2015 at 10:11 pm

    I should warn people about my experience with installing Linux Mint (very similar to Ubuntu) on the Macbook Pro Retina. Although your Mac can successfully boot Ubuntu in EFI mode, the hardware accelerated graphics will not work. Attempting to install the driver will result in a black screen on boot. Furthermore, if you have Windows installed alongside OS X, a Ubuntu install will make Windows unbootable. Lastly, attempting to remove your Ubuntu partitions may produce unexpected results; when I tried to get rid of the linux swap partition, Disk Utility failed to do so and instead deleted Recovery HD.

    A much better option is to simply install Ubuntu on an external hard drive in Master Boot Record/BIOS mode. Graphics acceleration will work, and the installation will not mess anything up. Format the external hd with the Master Boot Record partition scheme (NOT the default GUID partition table option), and boot into the disk/thumb drive option labeled "Windows", not "EFI Boot" to install Ubuntu. If you get any warnings about there not being a system reserved boot area or something like that, something isn't right.

    • Anonymous
      April 14, 2015 at 3:45 am

      how do you access the Master Boot Record/BIOS mode? Do you have steps to achieve this process?

    • Nathaniel
      April 14, 2015 at 4:20 am

      You can access the Master Boot Record/BIOS mode by selecting "Windows" instead of "EFI Boot" at the boot menu. Since I made that comment I discovered that you can in fact get accelerated graphics to work in EFI mode by installing experimental drivers from the xorg-edgers ppa. However, installing Linux in BIOS mode on an external hard drive is still the safest bet, especially if you have a Windows installation on your primary hard drive. I got all three OSs to boot on my primary hard drive, but it is a very complicated process, and you need the rEFInd boot manager to make it all work in a reasonable way.

  14. Andrew
    January 31, 2015 at 1:36 pm

    Great Article. Although Apple does have awesome hardware, the operating system is inferior. It has no maturity and constantly buggy. It seems as though OS's are released for the sakes of releasing them with no particular corporate strategy. With the amount of money they are making it is sheer corporate stupidity not to properly support the desktop platform.

    The reason I found your article was in hope of finding a rock-solid Linux OS that is EFI boot friendly and to get away from all that is Apple. Or I might just Bootcamp the whole drive and use W7.

  15. Ana Lourenco
    December 19, 2014 at 8:43 pm

    Hi!
    When I tryed to make a new partition it failed... All I had done was just adding a new partition with the format fress space and the partition failed... How can I fix this?

    Many thanks!

  16. quickshiftin
    November 13, 2014 at 5:46 pm

    Just when I thought I'd bricked my old MBP..., your notes on EFI Boot Fix saved me. Well done my friend!

  17. Jack
    November 5, 2014 at 7:43 am

    Hi. I'm just wondering what happened the my external hard drive after the installation? I used my external hard drive which has about 300gb of data on it. After I finished installing Ubuntu, when I plugged in my external drive my Mac said "the disk you inserted was not readable by this computer" Please help I need my data back.

  18. Wacek Kusnierczyk
    October 21, 2014 at 10:44 am

    Hi there, I have just installed kubuntu on a new mac pro, and it worked perfectly -- thanks for such a clear guide.

    However, there seems to be a problem while trying to upgrade Mac OSX to Yosemite. The installer says the disk cannot be used for the installation, and I suspect this is due to the tricks with EFI boor manager. I have changed the boor order to put Mac OS in front of linux, but it won't help.

    Do you have any advice on how to restore the original boot system, or fix the issue otherwise?

  19. Edward
    October 18, 2014 at 12:12 am

    I am also looking to by Macbook pro and going install ubuntu 14.04, is there any heating issue when running Ubuntu ?

  20. Andrea
    October 15, 2014 at 8:36 pm

    Hi, i'm very interest to install ubuntu on my mac book pro retina 15", i have some question before procede to the installation. How is the battery life? do you have some problem with the double video card? the hdmi port work fine or has some problem? and the sleep mode? if you have solved all this problem i will install ubuntu fast as possible :)

  21. victorv
    October 14, 2014 at 9:46 pm

    I made the install but got this error after

    sudo efibootmgr

    Fatal: Couldn't open either sysfs or procfs directories for accessing EFI variables.
    Try 'modprobe efivars' as root.

    Help!

  22. Ara Yeressian
    October 10, 2014 at 9:38 am

    Hi Danny. Does the external display work? Is the battery life the same as osx.
    Thnaks

  23. Gordy
    September 25, 2014 at 4:08 pm

    I have installed Linux on my Macbook pro but I do find that the Macbook does get quite hot when running Linux... how are your temps on yours?

    Any advice?

    • bg
      October 23, 2014 at 2:17 am

      install macfanctld

  24. Frank
    September 18, 2014 at 3:17 pm

    Hi,

    Do you have an uninstall guide for those who have followed these instructions to install? Just in case I would like to remove Ubuntu in the future.

    Thanks!

    • etse
      October 8, 2014 at 8:23 pm

      Two easy steps to uninstall:

      1) Remove Linux Partition(s).
      2) Expand Mac OS Partition to take advantage of newly free'd space.

    • Anonymous
      October 9, 2014 at 11:12 am

      Would this also take care of removing the GRUB safely?

  25. Jhow L
    July 27, 2014 at 3:06 pm

    I have a question about Linux mint 17 Cinnamon on the Mac Pro Retina. Its Hidpi didn't work, can you show me how to fix it? Thanks a lot.

  26. Nicolas Ehrhardt
    May 29, 2014 at 7:12 pm

    Battery life would be one of the main reason I would get a mac to probably install a flavor of Ubuntu on it. Could you tell us about the battery life you have using your ubuntu compared to macOS ?

    Thanks!

    • Danny S
      May 31, 2014 at 10:23 pm

      It's been pretty good. Still less than when running on Mac OS X, but I can still get a good 6-7 hours of light use out of it.

  27. archuser
    May 28, 2014 at 6:52 pm

    Cinnamon uses gnome 3 as back-end so has HiDPI Support, so no fantastic job done by Mint team.

  28. Aidan Harris
    May 26, 2014 at 5:02 pm

    Word of advice don't use Ubuntu but instead use the GNOME variety UbuntuGNOME (https://wiki.ubuntu.com/UbuntuGNOME/OneStopPage). I am typing this post from UbuntuGNOME using Firefox and it is so much more trusty (pun intended for those that get it) than Ubuntu and it's Unity desktop environment. If you follow all of the steps above but use UbuntuGNOME instead your eyes will thank you. Ubuntu does not yet have proper support for high dpi displays such as the MacBooks. Where as with UbuntuGNOME if you enable the "Large Text" option and change the text scaling and mouse cursor sizes it makes the entire OS easier to use. Ubuntu is great but I'd never recommend it for a MacBook. I also use the following extension in Firefox which makes it much easier to use:

    https://urandom.ca/nosquint/

    "Don’t worry – we don’t need to have Internet access right now, and it’ll detect the right driver to use whenever you boot up into your new installation later on"

    This is the only problem that I have ever encoutered installing Ubuntu on my MacBook. Ubuntu should detect the wifi drivers but this never happens (at least for me).

    I fixed this by using the ethernet-to-thunderbolt adaptor that I have and plugging that in before booting up the MacBook in order to gain Internet access.

    Once booted up I simply opened up a Terminal and typed the following:

    sudo su
    [Enter your password]
    apt-get update
    apt-get upgrade (not needed but you might as well check if there are any updates and if there install them)
    apt-get dist-upgrade (same as above not needed but you still might as well do it)
    apt-get install bcmwl-kernel-source (this command will install the Broadcom 802.11 Linux STA wireless driver)
    apt-get autoremove (this command also isn't needed but it doesn't hurt to input it)

    The above set of commands will fix any issues with the wifi and after inputting them you should be able to apply the wifi driver in "Additional Drivers"

    • Danny S
      May 27, 2014 at 3:03 pm

      Yeah, I've noticed this myself that Ubuntu still isn't all that good with HiDPI screens even though that's supposed to be "new and improved". Unity does scale to where things are readable, but it's sometimes still buggy and it looks weird. Since writing this article I've personally switched to Linux Mint 17, because they've done a fantastic job with adding HiDPI support to Cinnamon. It looks so much better now.

      While I plan on keeping that on my computer, you've made me curious enough to try Gnome Shell just to see how it behaves.