Dual-Booting OS X or macOS with Linux without rEFInd
Solution 1
Ubuntu installs grub and other files in the first EFI System partition on a Mac computer. Normally, this is the first partition on a Mac computer. The process of making the Ubuntu appear on the Startup Manager is a fairly trivial. The steps are given below.
Note: Starting with Ubuntu 18, the installer software should automatically create the files necessary to boot Ubuntu on a Mac. Therefore, Ubuntu 18 and later users should be able to skip steps 5 and 6.
-
Install Ubuntu.
-
When finished, restart and hold down the option key to invoke the Startup Manager. Select to boot from the OS X (or MacOS) volume.
-
Open a Terminal application window.
-
Mount the EFI System partition by entering the command given below.
diskutil mount disk0s1
-
Create a folder named
Boot
in the folder/Volumes/EFI/EFI
. You can use the Finder application or enter the command given below.mkdir /Volumes/EFI/EFI/Boot
-
Copy the file
grubx64.efi
from the folder/Volumes/EFI/EFI/ubuntu
to the folder/Volumes/EFI/EFI/Boot
. Next, rename this filebootx64.efi
. This step can be accomplished by using the the Finder application or by entering the command given below.cp /Volumes/EFI/EFI/ubuntu/grubx64.efi /Volumes/EFI/EFI/Boot/bootx64.efi
-
(Optional) Download a collection of icons from the sourceforge web site Mac icns. Use the Finder application to open the downloaded file
mac-icns.dmg
, then enter the command below to copy the Ubuntu icon fileos_ubuntu.icns
to the EFI System partition.cp /Volumes/mac-icns/OSX10.11.6/os_ubuntu.icns /Volumes/EFI/.VolumeIcon.icns
This will add the following Ubuntu icon to the Startup Menu.
Note: When finished, you can use the Finder application to eject the
mac-icns
volume. -
Use the Finder application or enter the command below to unmount the EFI System partition labeled
EFI
.diskutil unmount disk0s1
Solution 2
Be aware that neither rEFIt nor rEFInd damages, much less "wipes out," the default Apple boot loader; indeed, both rEFIt and rEFInd simply insert themselves into the boot process and then launch Apple's boot loader themselves.
Fundamentally, rEFIt and rEFInd are boot managers. A boot manager presents a menu or some other user interface tool to enable you to select which OS to boot. Most EFIs, including Apple's, include their own boot managers; however, these built-in boot managers are usually very primitive. On a Mac, you launch the built-in boot manager by holding down the Option (or Alt) key as the computer starts up (when the startup chime sounds). The Mac's built-in boot manager is awkward to access and limited in its capabilities. I presume this is what motivated Christoph Pfisterer to create rEFIt. I forked rEFIt into rEFInd after rEFIt fell into disrepair. I was more motivated by boot issues on UEFI-based PCs, but rEFInd remains a way around the limitations of Apple's boot manager.
A boot loader, by contrast, loads a kernel into memory and transfers control to it. A boot loader does not need to interact with the user directly (although it could). Neither rEFIt nor rEFInd is technically a boot loader, although the Linux kernel creates a blurred line, because it includes a feature (the EFI stub loader) that enables it to function as its own EFI boot loader. Also, some boot loaders, such as the GRUB 2 boot loader that's popular with Linux distributions, function as boot managers as well as being boot loaders.
If you're dual-booting Ubuntu and OS X (or macOS, as it's been recently re-named) on a Mac, it's a practical necessity to add something to the boot process. You could rely on Apple's boot manager to control which OS to boot, and in that case no non-Apple tool would be involved when booting OS X. You'd still need something (GRUB, rEFInd, or some other boot loader or boot manager) to launch a Linux kernel, though. Given that most of these tools are more convenient to use than is Apple's built-in boot manager, most users leave them set in the boot order such that they're called before the OS X boot manager.
If you simply dislike rEFInd, you can certainly do without it. You could rely on GRUB 2's boot manager features, or you could install another tool, like gummiboot/systemd-boot. In theory, if you install Ubuntu in EFI mode, it should install GRUB 2 in a way that will make it the default boot manager, and it should provide options for booting both Ubuntu and OS X. In practice, I'm not sure that will work -- Apple does everything a little differently, and so few enough people do it this way that I can't promise it would work. You could try it, though, and then fix any problems you encounter after the fact. I recommend learning more about EFI booting before you start, though, so that you don't make some basic mistake like booting the installer in BIOS mode or setting up your partitions in the wrong way. You might start with these pages:
- Adam Williamson's blog entry on how EFI works -- This page describes the theory behind EFI-mode booting.
- A question and answers on the differences between BIOS and EFI booting on Superuser.com -- This provides the basics of the preceding, but is more concise.
- My page on installing Linux on EFI systems -- This page is a more practical introduction to EFI-mode booting than Adam Williamson's blog.
- My page on the CSM -- This page covers the CSM, including when it's useful and when it's not. It's somewhat PC-centric, but most of the information applies to Macs.
- The Ubuntu community wiki entry on UEFI -- This page is a bit disjointed, but is the most Ubuntu-specific introduction to EFI and its issues.
If you decide to stick with the more traveled path of using rEFInd, be sure to check the date of any instructions you follow. Some very old pages are still out there, and they usually fail to address new issues like System Integrity Protection (SIP); or they describe using the abandoned rEFIt rather than the newer rEFInd. (Although rEFIt can still be made to work with newer OS X versions, doing so may require jumping through undocumented hoops.)
Related videos on Youtube
Admin
Updated on September 18, 2022Comments
-
Admin over 1 year
I think the title quite sums up the content of this post. I'd like to dual-boot a macbook pro 13' without having to use a third party boot loader. All the tutorials I've found use rEFIt o rEFInd to successfully boot Linux when it's been installed, but I'm not comfortable with the idea of wiping out the default Apple's boot-loader when, for me, it's the best thing when it comes to boot-loaders that I've ever seen.
Is there any way to make this?
Thanks!
-
Tanner over 3 yearsIt is possible to have Apple's EFI load an Ubuntu EFI stub directly, without the need for rEFInd or GRUB 2. See this question for instructions.
-
-
setholopolus over 7 years+1 Worked perfectly for me to install Linux Mint 18 as a dual boot with macOS Sierra on my 2014 Macbook Air
-
Arc676 over 7 yearsHow does step 7 work? Why would that only change the icon for the Ubuntu partition? Can I also change the icon for Macintosh HD so that there's a Sierra logo for the Mac partition and an Ubuntu logo for the Linux partition at the startup menu?
-
Arc676 over 7 yearsOK now I have the Ubuntu icon where you specified and a Mac icon in
/
on my Sierra partition. The Mac icon appears for Mac HD and the Ubuntu one for the other partition. However, I have a feeling that putting the icon where you specified just makes it the default icon because putting the icon in the root of the Ubuntu partition didn't work. What if I were to install a third OS? -
David Anderson over 6 years@Arc676: Installing a third OS may require a second EFI partition. There is no limit to the number of EFI partitions you can have. An example, of a second EFI partition, can be found at this answer.
-
jnkrois about 6 yearsThis answer saved me from insanity. I spent at least 4 days trying to solve an issue with my iMac. Basically, rEFInd corrupted the native display drivers of the iMac. Not sure how but it would make the default resolution be the lowest resolution. The solution to that problem would delete the rEFInd. Reinstalling rEFInd would corrupt the drivers again, and so on and so forth. Thanks @DavidAnderson.
-
Seamus almost 4 years
-
Seamus almost 4 yearsAs I understand all of this: If dual-booting macOS & Linux, one must use either
rEFInd
(or alternative) orgrub
to boot the Linux kernel. - have I got that correct? -
David Anderson almost 4 years@Seamus: The question was not on how to install Ubuntu. Your Q1 and Q2 links are to the same question, which at present has to two answers posted. I have posted answers on how to instal Ubuntu such has here.
-
Seamus almost 4 years@DavidAnderson: I goofed on the URL for Q2 - sorry about that.
-
Seamus almost 4 years@DavidAnderson: Yes - 2 answers to Q1, but one was just posted since I commented to japhwil's answer. The one from May 25 did not help me, and the poster didn't respond to my request for clarification.
-
Seamus almost 4 years@DavidAnderson: re your answer here: I recall seeing that answer, but I was confused by your reference to the use of the
VirtualBox image
. I don't useVirtualBox
, and I thought at the time that it was another "rabbit hole". I suppose my pre-conceived notion was that if it didn't use an ISO d/l fm Ubuntu, it wasn't going to help me. I've just re-read the answer & still confused as to what you've done here. Let me study it further & I'll post any questions there. -
Rod Smith almost 4 years@Seamus, there are other options besides those you've specified, but as a practical matter, something is needed to load the Linux kernel, and that "something" is usually either GRUB 2 or rEFInd. In theory, a Linux kernel with an EFI stub loader could be loaded directly by Apple's EFI, but this is a very awkward solution that's officially supported by few or no Linux distributions, AFAIK. See my page on installing Linux on EFI systems, referenced in my answer, for more details.
-
David Anderson almost 4 yearsI installed Ubuntu on a Mac. When I went to post the steps, I wanted to include images. To do this, I installed Ubuntu in a virtual machine. This allowed me to capture images which I used in my answer. The instructions are for installing Ubuntu on an actual Mac. The steps given in the answer start where the OP left off in the posted question. I do not think you read the question before reading my answer.
-
Seamus almost 4 years@DavidAnderson: You are correct - I have seen the light! :) +1
-
hyiltiz over 3 yearsCan rEFInd still boot macOS inside APFS partitions? I had a dual boot setup working but some grub update killed the dual. Holding Alt while powering on only shows a "Windows" icon which then says no OS found in a black screen. I can only boot directly into Debian if I set it at the top of the boot order via efibootmgr.