Multibooting OSX Lion & Ubuntu Linux on Macbook 4,1 without CD

Standard

Ubuntu 11.10 screenshot running unity desktop manager on macbook pro

 

 

Linux was a hobby of mine about ten years ago. A hobby you say? Yes, I don’t know why I got involved with it, but Linux just pulls you in, if you like computer science. Actually, I developed a bad habit of tweaking and patching Gentoo to fit my laptop at the time, until I was frustrated with driver support and time to get things done. Then I switched to OSX Tiger, which just worked, but had a simular feeling.

Recently i’ve been familiar with Linux once more, in a work related matter: Besides server maintenance and a VPN here and there, we’re developing a renderserver for unitedstyles on the linux platform. Just last month, i’ve installed ubuntu desktop on my wife’s netbook, and was surprised how well it looks and the applications that come with it. A lot of things have improved in the last decade, I became curious if I could install ubuntu on my own laptop as well. (a huge thing, not being locked into OSX but able to choose!) Ofcourse, i’m not looking to replace Lion but i’d like to be able to have access to the libraries and the repositories Linux users enjoy.

Prerequisties:

  1. Refit – to be able to boot to linux
  2. A experimental ISO-TO-USB EFI (mentioned later in the post)
  3. Ubuntu MinimalCD
  4. A USB which you can boot from
  5. Internet connection using UTP since we will install using MinimalCD (Alternatively use a livecd, however, I didn’t have success with any ISO)

I’ve started the search with bad news: Whilst most macbook + linux guide’s simply stat

e to pop-in the CD and boot from there, my laptop doesn’t have a CD player, and is running Lion.

This situation brought me two problems.

1. Need to boot linux from USB
2. Need to run the ISO in EFI mode or Lion EFI wouldn’t recognize it.

I’ll describe a bit what i’ve done in case someone else goes through the same process. I’ll go over the broad lines, if you have a question about the details, just ask me in the comments.

First download the ubuntu iso from the ubuntu site. I got Ubuntu 11.10 “Oneiric Ocelot” Minimal CD

I’ve started out by re-sizing a partition to make space for Linux. I made space at the end of the disk. Then I installed reFIT. Although many forums state there are problems with ReFIT in Lion, I had no problems using the automatic setup. After two or three reboots I was able to see the boot menu right after power on.

Then we prepare the USB disk. I was lucky to find a reference on studyblast who found some code from a German forum ‘apfeltalk‘.

  1. Get the ISO-2-USB EFI-Booter for Mac 0.01 beta
  2. Format a USB drive to provide a single FAT32 partition featuring MBR.
  3. Create the following directory: „/efi/boot“
  4. Copy the „bootX64.efi“ from „ISO-2-USB EFI-Booter for Mac 0.01 beta“ into „/efi/boot“ on your USB Drive
  5. Copy the Ubuntu image into „/efi/boot/“ on the USB Drive, too and rename it to „boot.iso“.
  6. You should have 2 files on your USB drive now: „bootX64.efi“ and „boot.iso“ – both in „/efi/boot“.
  7. You’re ready to reboot: During the startup of your Mac hold „Alt/Option“. You should see „EFI Boot“ which has a nice little USB Drive Symbol on it in the appearing boot menu. Boot from your USB Drive by clicking on the little arrow below it.

(tnx studyblast)

Macbook installing linux through other macbook to connect to the internet

Now this was finished, I was able to boot into linux setup. (However, the screen didn’t fit exactly, I was able to see enough to get though the steps). Just navigate though it and be careful in the partition step. I found another problem: Wifi didn’t work in setup, so I needed a UTP connection. I setup a second macbook and shared internet from there. I choose a EXT2 partition and setup 2GB of swap space.

I was investigating the situation. However, I did see the kernel load, ubuntu didn’t boot, just black screen of death. I decided to tinker with the setup and was able to boot with the bare minimum. Choose ‘recovery’ and remove the recovery. In the end, I found I could pass GRUB2 menu only when I choose recovery and removed the kernel flag ‘recovery’. 

 

setup grub recovery but remove recovery menu recordfail:

  • insmod gzip
  • insmod part_gpt
  • insmod ext2
  • insmod efi_gop
  • Set root='(hd0,gpt3)’
  • Search –no-floppy –fs-uuid
  • linux /vmlinnux ro nomodeset
  • initrd /initrd.img

Now I had a working kernel, in the right resolution, I could install ubuntu desktop. However, I found that my Radeon 8600M GT videocard wasn’t able to be picked up by PCI:0:0:1 slot due to the whole EFI deal. I made a quick attempt loading nVidia propriatary drivers.

The pure efi boot leads to the following kernel error message in syslog:

NVRM: failed to copy vbios to system memory.
NVRM: RmInitAdapter failed! (0x30:0xffffffff:832)
NVRM: rm_init_adapter(0) failed

I did found that GRUB2 can fake a ordinary bios, but the drivers don’t look for this alternative location. them, someone nicknamed mokaga pointed me to Nouveau by mentioning the exact same problem. So I downloaded a recent kernel (3.0.17 of linux) and applied this patch to it. But no results. Nouveau reports that it can’t find the video adapter. Not a problem for me at the moment, I just fell back to “Device “fsdev” in xorg.conf, and now ubuntu is showing fine!

The unnecessary but required screenshot

 

 

Sources:

http://studyblast.wordpress.com/2011/08/14/guide-mac-os-x-lion-how-to-boot-a-linux-live-system-from-a-usb-drive-how-to-update-any-ocz-ssds-firmware/

https://www.libreoffice.org/bugzilla/show_bug.cgi?id=35267

http://www.nvnews.net/vbulletin/showthread.php?t=162330

7 thoughts on “Multibooting OSX Lion & Ubuntu Linux on Macbook 4,1 without CD

  1. Ben

    I’m confused about some of these steps particularly the part at the beginning when you’re talking about resizing the partition and using refit. This seems to me to be something that I would do if I were looking to install linux on the hard disk. It’s not clear to me how this fits in. I think I need to understand this better, because at the moment this is not working for me.

    The steps I have taken (using linux in Parallels) are:

    1. wipe a USB disk using dd if=/dev/zero of=/dev/sdb
    2. partition the USB disk with fdisk. Here I set the partition to be of type ‘b’ (msdos vfat 32); I also marked the partition as bootable.
    3. formatted the partition mkfs.vfat -F 32 /dev/sdb1
    4. created the directories mkdir -p /mnt/sdb1/efi/boot
    5. copied boot.iso and bootX64.efi into /mnt/sdb1/efi/boot/

    When I reboot my macbook pro, I am able to select the boot rfi option from the boot menu. At this point I drop straight into a grub 1.99 prompt. Within grub I can see the partition and see the two files that I copied.

    No idea how to get this to boot though. Any ideas?

  2. Ben

    I’m confused about some of these steps particularly the part at the beginning when you’re talking about resizing the partition and using refit. This seems to me to be something that I would do if I were looking to install linux on the hard disk. It’s not clear to me how this fits in. I think I need to understand this better, because at the moment this is not working for me.

    The steps I have taken (using linux in Parallels) are:

    1. wipe a USB disk using dd if=/dev/zero of=/dev/sdb
    2. partition the USB disk with fdisk. Here I set the partition to be of type ‘b’ (msdos vfat 32); I also marked the partition as bootable.
    3. formatted the partition mkfs.vfat -F 32 /dev/sdb1
    4. created the directories mkdir -p /mnt/sdb1/efi/boot
    5. copied boot.iso and bootX64.efi into /mnt/sdb1/efi/boot/

    When I reboot my macbook pro, I am able to select the boot rfi option from the boot menu. At this point I drop straight into a grub 1.99 prompt. Within grub I can see the partition and see the two files that I copied.

    No idea how to get this to boot though. Any ideas?

    • Joop Dorresteijn

      Hi Ben, yes this instructions are about installing ubuntu on the hard disk. NOT boot from USB only. I wanted to ‘try’ ubuntu from USB but wasn’t able to do so because macbook pro 4,1 boots ubuntu 8,10.4 and 11.4 (server/desktop) with a black screen. The only environment I was succesful with was minimal. 

      Hope that helps!

  3. Hi, I am also trying to dual boot lion and ubuntu 11.10 on my MBP 8,1. I follow your instructions (using a cd instead of usb though) and reach the black screen after installing ubuntu. However, I cannot figure out your magic to make it boot normally. When entering the recovery mode, you specify some commands:

    setup grub recovery but remove recovery menu recordfail:insmod gzip
    insmod part_gpt
    insmod ext2
    insmod efi_gop
    Set root=’(hd0,gpt3)’
    Search –no-floppy –fs-uuid
    linux /vmlinnux ro nomodeset
    initrd /initrd.img

    However none of these commands work for me. Are they supposed to do anything for me?Thank you! Any help would be appreciated.

    • Anonymous

      Which ubuntu 11.10 are you trying? Desktop CD or minimum? With desktop cd and alternate I also only had black screen. Try to use minimum which I was succesful with. The fact you use a CD shouldn’t matter! What type of video card do you have in your 8,1?

  4. Garrett Lynch

    Hi

    I’m working with the studyblast solution on a live usb.  I manage to get Ubuntu booted but the screen looks like a corrupt/glitch image.  I can just about make out the clock on the bottom right and a few icons.  I’ve been told that this is an easy fix and that nomodeset needs to be set for the graphics card but all the solutions i find are for a hard drive installed Ubuntu where you can cd in and edit the grub file – how do you do this is it’s in an iso?

    Thanks
    Garrett

Leave a Reply