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.
- Refit – to be able to boot to linux
- A experimental ISO-TO-USB EFI (mentioned later in the post)
- Ubuntu MinimalCD
- A USB which you can boot from
- 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.
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.
- Get the ISO-2-USB EFI-Booter for Mac 0.01 beta
- Format a USB drive to provide a single FAT32 partition featuring MBR.
- Create the following directory: „/efi/boot“
- Copy the „bootX64.efi“ from „ISO-2-USB EFI-Booter for Mac 0.01 beta“ into „/efi/boot“ on your USB Drive
- Copy the Ubuntu image into „/efi/boot/“ on the USB Drive, too and rename it to „boot.iso“.
- You should have 2 files on your USB drive now: „bootX64.efi“ and „boot.iso“ – both in „/efi/boot“.
- 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.
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: 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!