Ubuntu – the current best way to dual boot a Mac with Ubuntu on the latest 10.12 macOS

bootloaderdual-bootmacrefinduefi

I spend the last 3 nights searching every corner of the web for a straightforward guide how to dualboot the latest macOS 10.12 Sierra with Ubuntu, but it seems like there is just so many ways people recommend doing, that in other forums people are advising against at. My ideal scenario would of course be to select either macOS or Linux via the alt-Key in Apple's standard bootloader. David Anderson made a post about this which seems really appealing to me, nonetheless I am a bit sceptical because there are no reviews or answers to his method (not questioning his competence) and most people recommend using rEFInd anyways.

Installing Ubuntu on Mac with macOS and Windows already installed

I am certainly ok with that and I have read the relevant arcticles on Rod Smiths website, but since every new version of macOS (especially since the integration of SIP in El Capitan) appears to change the way it handles the booting process and the majority of articles regarding this subject is older than 10.11, which makes me feel a bit lost at the the moment. My biggest concern regarding rEFInd is the malfunctioning of the hibernation feature other users complain about.

My setup consists of a Mid-2012 non-retina Macbook Pro running on macOS 10.12.3. As far as my knowledge goes by now, I am planning to:

  • create three new hfs+ partions as placeholders in macOS using disk utility (a small one for refind, a main root partition for Ubuntu and a swap partition)
  • install Ubuntu, reformat the main Linux partition and select the swap partition (do I have to change the location for the bootloader installation?)
  • reboot into Recovery Mode and install rEFInd ./refind-install --ownhfs /dev/disk0sX afterwards so it is able to find an existing Ubuntu and skip GRUB during boot

I have read that installing rEFInd on the a seperate hfs partition would fix the hibernation issue. In this case, do I have to select/reformat the little hfs partition as an EFI system partition during the Linux install (like David Anderson suggests)? And which volume do I set for the bootloader installation?

In another thread a user stated that since El Capitan we were better off installing not installing rEFInd on a seperate hfs, but without stating why. Additionally, a supportive argument for this statement is of course the fact that rEFInd installs itself on the standard EFI partition by default in its newer versions. Even if would I do everything the default way (including the risk of the hibernation issue), what are the correct partition choices while installing Ubuntu? Do I need to define an new EFI system partition in this case, or not at all?

As you may have noticed, I have many questions and I apologize in advance if this post seems confusing to you. I will appreciate any kind of help.

Kind regards,
Tim

Best Answer

  • I spend the last 3 nights searching every corner of the web for a straightforward guide how to dualboot the latest macOS 10.12 Sierra with Ubuntu, but it seems like there is just so many ways people recommend doing, that in other forums people are advising against at.

    You're running into the paradox of choice -- too many options on this matter are creating confusion. In reality, it's hard to say that any one option in this specific issue is really any better than any other option, except in fitting certain very specific goals, most of which you haven't mentioned any preferences on, except:

    My ideal scenario would of course be to select either macOS or Linux via the alt-Key in Apple's standard bootloader.

    In this case, the solution to which you linked makes sense, although I suspect it may be a little bit overly-complex in a couple of points. (I'm not 100% positive of that, though.)

    Note, however, that the screen you see when you hold down the Alt/Option key when booting a Mac is not a boot loader; it's a boot manager. You're still relying on separate boot loaders (Apple's boot.efi file to boot macOS or GRUB to boot Linux) to boot the computer. This is, in some sense, a minor matter of terminology; but it's important to understand that boot managers are user interface tools whereas boot loaders load kernels into memory and execute them, since in some contexts this distinction is very important. Unfortunately, people tend to be sloppy about this distinction.

    every new version of macOS (especially since the integration of SIP in El Capitan) appears to change the way it handles the booting process and the majority of articles regarding this subject is older than 10.11, which makes me feel a bit lost at the the moment.

    Yes, the ever-changing nature of macOS booting can be a problem. I recommend you begin by ignoring anything that suggests installing Linux in BIOS/CSM/legacy mode. Although doing this is sometimes necessary, that's rarely the case today. Broadly speaking, you're then left with two choices:

    • What to use as a boot manager -- Above, you expressed a preference for the Mac's built-in boot manager. This tool is limited, but you know it's already present in the computer. The two major alternatives are GRUB 2 (which is installed by Ubuntu, but I've seen few discussions of using it to boot macOS) and rEFInd (which you're obviously aware is a popular choice on Macs). rEFIt used to be a good alternative, too, but it's been abandoned for years, so rEFInd (which I forked from rEFIt) is a better choice.
    • What to use as a boot loader -- Both the method you cited and any method that uses GRUB as a boot manager are likely to use GRUB as the boot loader, too. rEFInd can do the same, but rEFInd can also use the EFI stub loader, which is a kernel feature that turns the Linux kernel into its own boot loader.

    Note that GRUB is both a boot manager and a boot loader. rEFInd, OTOH, is technically only a boot manager; but the existence of the EFI stub loader (which is technically a boot loader but not a boot manager) enables rEFInd to act like a boot loader of Linux kernels.

    My biggest concern regarding rEFInd is the malfunctioning of the hibernation feature other users complain about.

    This was a big problem a while back, but I haven't seen any recent complaints about it, so I believe that the current defaults in refind-install fix this problem. As you suggest, installing rEFInd to a separate HFS+ partition is one reported solution, so you could always try that if you install rEFInd to the ESP and then run into problems.

    It's possible to switch boot managers and loaders even after you've installed everything. On this specific issue, if you decide to use rEFInd, you can hedge your bets a bit by setting aside a ~200 MiB partition. Don't even put a filesystem on it initially. Install rEFInd using its defaults, which will put it on the ESP. If you have problems, you can then put an HFS+ filesystem on the small spare partition and re-install rEFInd to it. If this resolves the problem, great. If not, you can put GRUB 2 on the small HFS+ partition in a variant of the method described in on the page to which you linked.

    install Ubuntu, reformat the main Linux partition and select the swap partition (do I have to change the location for the bootloader installation?)

    If the Ubuntu installer runs in EFI mode, it will install GRUB 2 to the ESP. If there's even a prompt for where to install the boot loader, it's ignored in EFI mode.

    It's also worth pointing out that, if you intend to use rEFInd and the EFI stub loader, you can launch the Ubuntu installer by booting into "try before installing" mode, open a Terminal window, and typing ubiquity -b. The -b option tells the installer to not install GRUB. This will minimize the chance of a boot coup in the future, and it will prevent GRUB from running time-consuming scripts whenever the kernel is updated to modify its configuration files (which you wouldn't be using if you're not including GRUB in the boot process).

    I have read that installing rEFInd on the a seperate hfs partition would fix the hibernation issue. In this case, do I have to select/reformat the little hfs partition as an EFI system partition during the Linux install (like David Anderson suggests)?

    No. Technically, an ESP must use the FAT filesystem. In practice, a Mac's firmware doesn't care whether a partition is marked as an ESP or as a standard HFS+ partition when it launches a boot loader.

    I should also point out that I don't see the point of creating a second ESP in the instructions to which you've linked. Maybe I'm missing something, though.

    Even if would I do everything the default way (including the risk of the hibernation issue), what are the correct partition choices while installing Ubuntu? Do I need to define an new EFI system partition in this case, or not at all?

    No, the ESP is intended to be shared by all the OSes on the computer. In the case of Macs, though, Apple uses it only for firmware updates, AFAIK; its boot loader resides on its Recovery HD volume.

    That said, you can create multiple ESPs; doing so is legal and, AFAIK, all EFIs support such configurations. There's just little or no point to doing so.