I've been trying the whole day to let my MacBook recognise Ubuntu in the boot menu (alt on startup). I really don't wanna install rEFIt. Is there any other way? Thanks very much!!
1 Answers
First, rEFIt is abandonware; it hasn't been updated in six years. Because of this, I created a rEFIt fork called rEFInd, which is under active development and that works better with both Linux (including Ubuntu) and recent versions of OS X than does rEFIt. Thus, if you can't get it working the way you want, please look into rEFInd instead of rEFIt.
That said, there are two ways to install Ubuntu under OS X, each of which has several variants. The answer to your question depends on which method, and variant, you choose:
- BIOS/CSM/legacy mode -- Much older documentation describes installing Ubuntu on a Mac using the Compatibility Support Module (CSM), aka BIOS-mode or legacy-mode support. In its simplest-to-install configuration, this involves booting the Ubuntu installer in BIOS mode and letting it install GRUB 2. You should then get an option on the Mac's boot menu for booting a BIOS-mode OS. IIRC, it doesn't know the difference between different boot loaders, so it will call GRUB 2 "Windows," but it should work. You could install LILO, GRUB Legacy, or a more exotic boot loader instead of GRUB 2, if you preferred, but this would involve jumping through extra hoops. The big problem with this approach is that it requires the use of a hybrid MBR, which is an ugly and dangerous hack. If you don't understand GPT, MBR, and hybrid MBR, I STRONGLY advise against this approach, because it will become far too easy for you to end up trashing your hard disk. If you do understand these topics, you can probably do it this way without causing too many problems, but it's still not my personal first choice.
- EFI mode -- An EFI-mode installation of Ubuntu obviates the need for a hybrid MBR, which makes it much safer. There are a number of ways to do this, but broadly speaking, they fall into two categories:
- A standard EFI installation -- On a UEFI-based PC, Ubuntu installs the EFI-mode GRUB 2 to the EFI System Partition (ESP) and adds an entry that points to GRUB to the NVRAM boot manager list. Unfortunately, Apple's EFI doesn't use this boot menu list in quite the normal way, so although this approach can make GRUB the default boot manager, it's not likely to show up on the Mac's GUI boot menu. GRUB might or might not be able to boot OS X (I've seen reports of both successes and failures). Thus, a regular EFI-mode install of Ubuntu to a Mac can be problematic. With enough persistence and knowledge of GRUB, you may be able to get it to work, but not in quite the way you say you want.
- Pretending to be Mac OS X -- OS X installs its boot loader as
/System/Library/CoreServices/boot.efi
on an HFS+ volume. If you create an HFS+ volume and copy GRUB 2 (grubx64.efi
) to that name, along with a few support files, OS X's system chooser will notice it and enable you to pick it. See this blog post for more on this approach. Ubuntu doesn't support this type of install, though (unless it's new for 16.04 and I haven't yet learned of it). Thus, if you want to use this method, you'll need to set it up manually. Also, there were some changes recently (to El Capitan, IIRC -- or maybe to Yosemite) that seem to require some extra support files for the selection to show up in OS X's own boot picker. I haven't yet researched those changes, so I don't yet know precisely what might be needed. If you want to try this method of installation, it's probably best to do a regular EFI-mode install and then copy the main GRUB 2 file and its support files to a small HFS+ volume, then add the Mac-specific support files. Note that you must either create a dedicated GRUB 2 HFS+ volume or use a previously-unbootable HFS+ volume. You must not try to use your regular OS X volume for this purpose, since that would wipe out the OS X boot loader, rendering OS X unbootable.
Note also that the initial boot mode of the Ubuntu installer (that is, BIOS vs. EFI) determines whether it will install a BIOS-mode or EFI-mode GRUB. Thus, you must control this boot mode. Apple's boot manager may be unclear on this, or may not even give you the option you want. (Details vary depending on Mac model, firmware version, and how the boot medium was prepared.) Once you've booted Ubuntu, you can check your boot mode by looking for a directory called /sys/firmware/efi
. If that directory is present, you've booted in EFI mode; if it's absent, you've booted in BIOS mode.
All together, none of these options is both easy and good -- a BIOS-mode install is easy but ugly and potentially dangerous; and EFI-mode booting is harder to set up but safer and cleaner. This is one of the reasons so many Mac users use rEFInd (or rEFIt before it).
Note that rEFInd need not add anything to the Ubuntu boot complexity, since it can replace GRUB 2. Depending on how you configure it, a boot through rEFInd involves the rEFInd menu appearing. This menu can direct the boot process to OS X's boot loader, boot GRUB 2 (BIOS-mode or EFI-mode, assuming it's installed), or boot a Linux kernel directly. Because of this last possibility, GRUB 2 need not even be installed. If you want to do this, the easiest approach is:
- Boot the Ubuntu installer in either BIOS mode or EFI mode (which is mostly irrelevant).
- When prompted, select the option to try Ubuntu without installing it.
- Open a Terminal window in the Ubuntu live session.
- Type
ubiquity -b
. This launches the Ubuntu installer, but tells it to not install GRUB 2. - Install Ubuntu. Ideally, do not create a separate
/boot
partition; but if you do (to support LVM, RAID, or disk encryption), take note of the identity of your Ubuntu root (/
) partition (/dev/sda5
,/dev/mapper/ubuntu-root
, or whatever). Also, use ext4fs for the partition that holds the Linux kernel (the root [/
] partition or, if you use one, your separate/boot
partition). - Reboot. OS X should come up.
- Install rEFInd.
- Reboot. rEFInd should come up and give you options for both OS X and Ubuntu. Test them both. If you created a separate
/boot
partition, you must perform some extra steps:- When you highlight the Ubuntu option, do not hit Enter; instead, hit F2 or Insert twice.
- Add
ro root={whatever}
to the options, where{whatever}
is your root (/
) filesystem identifier. - In Ubuntu, locate the
mkrlconf
script that came with rEFInd and run it. (You should be able to run it from your OS X volume; or you can re-download the rEFInd.zip
file, unpack it, and run it from there.) - When you reboot, you should be able to boot Ubuntu by hitting Enter after selecting it in the rEFInd menu.
If you want to avoid rEFIt because you usually want to boot OS X (or Ubuntu) and don't want to deal with the menu, be aware that you can adjust rEFInd so that its menu appears only if you hold down a key while booting: Edit the refind.conf
file so that the following options are set:
timeout = -1
default_selection = "OS X"
You can adjust default_selection
as desired, of course.

- 44,284
- 7
- 63
- 105