I'm trying to determine the best steps to install Ubuntu on a Macbook Pro 9,1 (mid 2012). I followed the information here and was able to get it up and running:
I had several issues however, the first two pretty major, the third a bit minor:
Suspend flat out did not work in Ubuntu. Closing the lid seemed to suspend it but upon opening, the screen just remained blank indefinitely. The fans were on, I could tell it was running -- but I had to simply hold the power button to shut down, and then power it back on.
Every time there is a kernel update I have to copy the new initrd and vmlinuz files over to the HFS+ partition and update refind.conf. I'm keeping journaling enabled on the HFS+ partition which means I cannot write to it. So really, every time there is a kernel update I have to
copy the two files somewhere (use scp, create a small FAT32 partition, etc.)
reboot into OS X
copy the new files to /EFI/ubuntu
update refind.conf to boot the new kernel
I would like to get bumblebee installed to get the graphics cards to properly switch (intel vs. nvidia 650M). Hopefully this will help with battery life and according to the rEFInd docs "On some models with multiple graphics chipsets, you can't select which chipset to use in BIOS mode, but you can in EFI mode". Thus -- I guess I need to make sure I boot in EFI mode.
Manually copying the two files from /boot is a real pain. Is there any way around that? I had an old mid 2006 macbook pro (I think 2,1?) running rEFIt and never had to do this file copying to get it to work (though granted, it was using grub and BIOS emulation).
I suspect that suspend may actually be working but the graphics drivers aren't playing nicely -- so the screen is blank when I open it back up. So perhaps getting the graphics working is key to getting suspend as well?? I didn't think to try a virtual terminal when it was doing this. Unfortunately this is my new work laptop and I have since wiped the drive, repartitioned, and am holding off on installing Ubuntu again until I have some further information. In the meantime I worked on getting the code built and deployed (which I was able to do prior to day 1 at the new job...woo hoo!).
Additionally, let me ask an easier question (hopefully)...
Now that I have reinstalled OS X I decided to put my bootable USB key into the system and reboot -- without rEFInd installed at all. I held down the option key at boot time and it gave me two options that were clearly tied to the USB key:
Windows (which when selected results in a boot error)
EFI boot
Upon selecting option 2 I am able to boot into Ubuntu and the installer looks like it will work just fine. I didn't pull the trigger with the install as I start my new job tomorrow and I would like to get a time machine backup before any further installations. However, it appears to boot the USB key just fine. While I haven't checked, my guess is that the key is a FAT32 filesystem so that it can be compatible with as many systems as possible. However, it begs the question:
Is rEFInd even necessary at all? I see that Ubuntu can boot directly in EFI mode:
However, I also see that rEFInd contains an ext4 driver, which is something that I do not believe OS X has out-of-the-box.
Thus, is rEFInd required (along with the ext4 driver) so that the Mac hardware can read the ext4 filesystem where Ubuntu is installed, or is it simply giving me a pretty/configurable boot menu? (not to discount your efforts -- what you have done is quite impressive and most appreciated!!) In other words, can I just install Ubuntu on my second partition and then hold the option key at boot time to select that I want it instead of OS X?
And if I do decide to install without rEFInd, does this imply a hybrid MBR setup, or is there some other drawback besides having to hold the option key at startup?
Last edit: bdmayes 2013-10-09
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Well for what it's worth -- if anyone else is reading this with the same questions, I did set this up shortly after posting my question. I partitioned the drive and launched Ubuntu from a USB key. I went ahead and selected the option to install it alongside OS X but did NOT configure rEFInd. After rebooting, there didn't seem to be any way possible to boot into Ubuntu, even when holding down the option key at startup. Thus, installing rEFInd (or rEFIt...but I'm not sure why you would want code that is no longer maintained) is indeed necessary.
So after installing Ubuntu and not being able to boot it, I just installed rEFInd in OS X and it easily located Ubuntu and booted it just fine. The process I performed was very similar to the following:
I made sure NOT to use the "custom" Mac version of Ubuntu (as noted in the docs this will ironically cause a hybrid MBR configuration). Instead, I just used the default 64-bit installer and then followed the steps to configure refind_linux.conf with the UUID of my partition.
It works great! Whenever a kernel update occurs, rEFInd will show two Ubuntu options in the menu. To get around this, after testing that the new kernel works without issue, I simply cd into /boot and rename all of the files to begin with "old" so that rEFInd doesn't pick them up. For example, I was on 3.8.0-19 when I installed Ubuntu, and then after getting all of the updates the kernel was updated to 3.8.0-31. So rEFInd would give me the option to boot either one. Once I realized that the 3.8.0-31 kernel booted and worked, I just went into /boot and run this:
for i in *19*; do sudo mv $i old.$i; done
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm afraid I can't help with issues #1 and #3 in your first post -- those are hardware-specific issues that will require hardware-specific answers. You might try posting on the Ubuntu forums; there are a number of people there who are familiar with a wide variety of Apple hardware who might know answers.
You've discovered the answer to your issue #2: By using rEFInd's ext4fs driver, rEFInd can auto-detect your kernels in their "native habitat," as it were. Personally, I recommend either leaving all your kernels in place or using dpkg to delete your old kernel packages after you've confirmed that the new one works. Renaming the kernel as you've been doing means that they'll collect in the /boot directory, wasting space. If /boot is a separate partition, it may even fill up.
You ask:
Is rEFInd even necessary at all? I see that Ubuntu can boot directly in EFI mode:
In a simplistic sense the answer is "no"; however, that simplistic answer is also deceptive. The reason is that there are at least two functions you probably want in your pre-boot environment:
The ability to choose which OS to boot. This is handled by a program called a boot manager, and rEFInd is one of several boot managers that work on EFI systems such as Macs. Others include GRUB 2, rEFIt, and gummiboot.
The ability to load an OS kernel into memory and start it running. This is handled by a program called a boot loader. rEFInd is not a boot loader, but it can launch a boot loader. EFI boot loaders for Linux include GRUB 2, ELILO, SYSLINUX, and the EFI stub loader.
A boot loader is absolutely required, and a boot manager is a practical necessity in a multi-boot environment. Apple's firmware includes a boot manager (it's what appears when you hold down Alt/Option at boot time), but it's primitive. GRUB 2 can fill both roles; however, most Linux distributions (including Ubuntu) do a poor job of integrating it into the Mac's software stack, so it's likely to require manual tweaking or supplementing with another boot manager.
rEFInd can work fairly seamlessly once it's set up because it can detect and use Linux kernels that are compiled with the EFI stub loader, which is a kernel component that turns the kernel into its own boot loader. This makes reconfiguring rEFInd for new kernels unnecessary -- a unique feature in Linux boot managers/boot loaders. (Most distributions have scripts that modify their GRUB setups whenever a new kernel is installed, so users don't have to do anything special when using the distribution's own kernels, but updates are still necessary behind the scenes.)
Thus, rEFInd is not necessary, but you do need both a boot loader and probably a boot manager. Ubuntu is unlikely to set these up satisfactorily, so you'll need to either adjust how it does things or set up something else (such as rEFInd or gummiboot) to supplement or replace GRUB.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My apologies, but I never did notice your response here until now. It is excellent and much appreciated.
For what it's worth, if anyone else stumbles upon this thread then the issues regarding the graphics drivers and suspend still seem to elude me for this particular hardware. I was eventually able to disable the nvidia card entirely and use only the Intel chipset/drivers, which results in better battery life and the ability to properly suspend. Unfortunately, it also fails to recognize external monitors under this configuration (which was a deal-breaker for me). The details of accomplishing this are documented here:
I haven't successfully been able to disable the Intel card and use only the nvidia card either. Battery life isn't as good in this configuration, but it would hopefully solve all of my other problems. Unfortunately I'm stuck. The details of that (as of now) unresolved issue can be found here:
I'm trying to determine the best steps to install Ubuntu on a Macbook Pro 9,1 (mid 2012). I followed the information here and was able to get it up and running:
http://randomtutor.blogspot.com/2013/02/installing-ubuntu-1304-on-retina.html
I had several issues however, the first two pretty major, the third a bit minor:
Suspend flat out did not work in Ubuntu. Closing the lid seemed to suspend it but upon opening, the screen just remained blank indefinitely. The fans were on, I could tell it was running -- but I had to simply hold the power button to shut down, and then power it back on.
Every time there is a kernel update I have to copy the new initrd and vmlinuz files over to the HFS+ partition and update refind.conf. I'm keeping journaling enabled on the HFS+ partition which means I cannot write to it. So really, every time there is a kernel update I have to
I would like to get bumblebee installed to get the graphics cards to properly switch (intel vs. nvidia 650M). Hopefully this will help with battery life and according to the rEFInd docs "On some models with multiple graphics chipsets, you can't select which chipset to use in BIOS mode, but you can in EFI mode". Thus -- I guess I need to make sure I boot in EFI mode.
Manually copying the two files from /boot is a real pain. Is there any way around that? I had an old mid 2006 macbook pro (I think 2,1?) running rEFIt and never had to do this file copying to get it to work (though granted, it was using grub and BIOS emulation).
I suspect that suspend may actually be working but the graphics drivers aren't playing nicely -- so the screen is blank when I open it back up. So perhaps getting the graphics working is key to getting suspend as well?? I didn't think to try a virtual terminal when it was doing this. Unfortunately this is my new work laptop and I have since wiped the drive, repartitioned, and am holding off on installing Ubuntu again until I have some further information. In the meantime I worked on getting the code built and deployed (which I was able to do prior to day 1 at the new job...woo hoo!).
I have read this page twice and I'm still lost:
http://www.rodsbooks.com/ubuntu-efi/index.html
It looks like I no longer need the really long, complicated set of steps since I'm using a 3.8 kernel? Any ideas?
I would really prefer running Ubuntu than OS X on this thing if at all possible. Thanks!
Last edit: bdmayes 2013-10-08
Additionally, let me ask an easier question (hopefully)...
Now that I have reinstalled OS X I decided to put my bootable USB key into the system and reboot -- without rEFInd installed at all. I held down the option key at boot time and it gave me two options that were clearly tied to the USB key:
Upon selecting option 2 I am able to boot into Ubuntu and the installer looks like it will work just fine. I didn't pull the trigger with the install as I start my new job tomorrow and I would like to get a time machine backup before any further installations. However, it appears to boot the USB key just fine. While I haven't checked, my guess is that the key is a FAT32 filesystem so that it can be compatible with as many systems as possible. However, it begs the question:
Is rEFInd even necessary at all? I see that Ubuntu can boot directly in EFI mode:
https://help.ubuntu.com/community/UEFI
However, I also see that rEFInd contains an ext4 driver, which is something that I do not believe OS X has out-of-the-box.
Thus, is rEFInd required (along with the ext4 driver) so that the Mac hardware can read the ext4 filesystem where Ubuntu is installed, or is it simply giving me a pretty/configurable boot menu? (not to discount your efforts -- what you have done is quite impressive and most appreciated!!) In other words, can I just install Ubuntu on my second partition and then hold the option key at boot time to select that I want it instead of OS X?
And if I do decide to install without rEFInd, does this imply a hybrid MBR setup, or is there some other drawback besides having to hold the option key at startup?
Last edit: bdmayes 2013-10-09
Well for what it's worth -- if anyone else is reading this with the same questions, I did set this up shortly after posting my question. I partitioned the drive and launched Ubuntu from a USB key. I went ahead and selected the option to install it alongside OS X but did NOT configure rEFInd. After rebooting, there didn't seem to be any way possible to boot into Ubuntu, even when holding down the option key at startup. Thus, installing rEFInd (or rEFIt...but I'm not sure why you would want code that is no longer maintained) is indeed necessary.
So after installing Ubuntu and not being able to boot it, I just installed rEFInd in OS X and it easily located Ubuntu and booted it just fine. The process I performed was very similar to the following:
http://blog.kylebarlow.com/2013/05/installing-ubuntu-1304-raring-ringtail.html
I made sure NOT to use the "custom" Mac version of Ubuntu (as noted in the docs this will ironically cause a hybrid MBR configuration). Instead, I just used the default 64-bit installer and then followed the steps to configure refind_linux.conf with the UUID of my partition.
It works great! Whenever a kernel update occurs, rEFInd will show two Ubuntu options in the menu. To get around this, after testing that the new kernel works without issue, I simply cd into /boot and rename all of the files to begin with "old" so that rEFInd doesn't pick them up. For example, I was on 3.8.0-19 when I installed Ubuntu, and then after getting all of the updates the kernel was updated to 3.8.0-31. So rEFInd would give me the option to boot either one. Once I realized that the 3.8.0-31 kernel booted and worked, I just went into /boot and run this:
I'm afraid I can't help with issues #1 and #3 in your first post -- those are hardware-specific issues that will require hardware-specific answers. You might try posting on the Ubuntu forums; there are a number of people there who are familiar with a wide variety of Apple hardware who might know answers.
You've discovered the answer to your issue #2: By using rEFInd's ext4fs driver, rEFInd can auto-detect your kernels in their "native habitat," as it were. Personally, I recommend either leaving all your kernels in place or using
dpkg
to delete your old kernel packages after you've confirmed that the new one works. Renaming the kernel as you've been doing means that they'll collect in the/boot
directory, wasting space. If/boot
is a separate partition, it may even fill up.You ask:
In a simplistic sense the answer is "no"; however, that simplistic answer is also deceptive. The reason is that there are at least two functions you probably want in your pre-boot environment:
A boot loader is absolutely required, and a boot manager is a practical necessity in a multi-boot environment. Apple's firmware includes a boot manager (it's what appears when you hold down Alt/Option at boot time), but it's primitive. GRUB 2 can fill both roles; however, most Linux distributions (including Ubuntu) do a poor job of integrating it into the Mac's software stack, so it's likely to require manual tweaking or supplementing with another boot manager.
rEFInd can work fairly seamlessly once it's set up because it can detect and use Linux kernels that are compiled with the EFI stub loader, which is a kernel component that turns the kernel into its own boot loader. This makes reconfiguring rEFInd for new kernels unnecessary -- a unique feature in Linux boot managers/boot loaders. (Most distributions have scripts that modify their GRUB setups whenever a new kernel is installed, so users don't have to do anything special when using the distribution's own kernels, but updates are still necessary behind the scenes.)
Thus, rEFInd is not necessary, but you do need both a boot loader and probably a boot manager. Ubuntu is unlikely to set these up satisfactorily, so you'll need to either adjust how it does things or set up something else (such as rEFInd or gummiboot) to supplement or replace GRUB.
My apologies, but I never did notice your response here until now. It is excellent and much appreciated.
For what it's worth, if anyone else stumbles upon this thread then the issues regarding the graphics drivers and suspend still seem to elude me for this particular hardware. I was eventually able to disable the nvidia card entirely and use only the Intel chipset/drivers, which results in better battery life and the ability to properly suspend. Unfortunately, it also fails to recognize external monitors under this configuration (which was a deal-breaker for me). The details of accomplishing this are documented here:
http://ubuntuforums.org/showthread.php?t=2223347
I haven't successfully been able to disable the Intel card and use only the nvidia card either. Battery life isn't as good in this configuration, but it would hopefully solve all of my other problems. Unfortunately I'm stuck. The details of that (as of now) unresolved issue can be found here:
http://ubuntuforums.org/showthread.php?t=2224567