Wednesday, October 27, 2010

My Mac-SUSE Journey - Part 1

After many months of consideration and research, I bought a brand new MacBook Pro 13" in early October. I needed a handy appliance where I can do Photos, Movies, Music, browse the web... iPhone is too small, iPad is nice but not computationally powerful or mature/proven. After spending close to 4 weeks on my Macbook Pro (version 7,1), I'm a very happy customer. sengihnampakgigi

It wasn't long before, 2 days post-acquisition really, I started wondering about putting SUSE on it. Sure, I've discovered Terminal & X11 in Mac OS X and it works great. senyum I use VirtualBox to virtualize SLES & openSUSE. But I still wanna have SUSE run natively to do KVM, maybe Xen and just because I can... peace

I am not the first, nor the last, to do this so I will acknowledge the wealth of information & helpful folks out there on the Web (see reference section further below).

Before we begin, please indulge my trip down memory lane... my very first computer was the Apple PC-IIe and it looks like the picture below... and who could forget the timeless Karateka... filling my little mind with boundless fluid moves... that does very little in real life... well... it did get me into trouble a few times... only a few. gelakguling



My next brush with Apple was during my undergraduate days where I spent many hours doing tutorials and projects in the Mathematics/Statistics/Simulation labs filled with rows of Macintoshes (see pic below)... good times. pinokio



I graduated just as the technicolor iMac G3 invaded the campus. angkatkening

The Mac hardware and software has come a long way and I'm very impressed and pleased with my purchase. Despite my previous encounters with the Mac, about the only thing familiar was the good old Finder and that static menu bar at the top. As I use Mac OS X "Snow Leopard", I find good things/ideas that should be implemented in openSUSE/KDE... but I will blog about this in more detail another time.

Enough rambling, here are the steps to installing openSUSE 11.3 (64-bit) onto a Macbook Pro 13" (2010 edition) running Mac OS X 10.6.4:


Disk Partitioning

My hard disk was upgraded from 250Gb to 320Gb. I decided to take 25Gb away for openSUSE 11.3. I did not use the Boot Camp Assistant utility on Mac OS X but instead used the Disk Utility.



As shown in screenshot above, I shrunk my Mac OS X partition from 320Gb to 295Gb. Next, I split the remaining free space into 21Gb for my root partition and 4Gb for swap partition. You can format them as DOS/FAT and let openSUSE reformat them at installation.


Dual-boot Setup

Now that some disk space has been carved up for openSUSE 11.3, its time to make the MacBook Pro dual-boot. Unfortunately, the usual Grub bootloader doesn't work here. To spare you (and myself) the details, the way to dual-boot a MacBook Pro is to use rEFIt (pronounced Refit).

Download the freely available rEFIt, version 0.14 at the time, and install it. I followed the documentation and installed it via the "Automatic Installation with the Installer Package" section at http://refit.sourceforge.net/doc/c1s1_install.html

To verify you've installed this correctly, reboot your MacBook Pro and you should see a boot menu on startup where you use the arrow and Enter keys to select which OS to boot. You should only see one option at this time since you have not installed a second OS on the MacBook Pro yet.


Installation

Pop in the openSUSE 11.3 (64-bit) installation DVD into the drive and shutdown Mac OS X. Power-on the MacBook Pro and press and hold the "c" button so that it will boot from the DVD drive. I usually press and hold the "c" button till I hear the DVD drive spinning up the media before I let go.

You should see the usual stuff when installing openSUSE, the kernel and initrd will load, nice fancy splash screen shows up and you select Installation to start the process. Pretty straightforward.

The most important part of the installation is disk partitioning because you really do NOT want to install openSUSE over Mac OS X. Thanks to the simple partitioning scheme where rEFIt has the first partition and Mac OS X has the second partition of 295Gb, that's easy to spot. When you reach that part of the installation where openSUSE installer proposes a disk layout, do NOT accept the defaults but instead choose to do Custom Partitioning and ensure that you do NOT touch that first and second partition. Select the 21Gb partition, format it with your favourite filesystem (ext3 for me) and mount it as root /. Next select the 4Gb partition, format it as Swap.



The next equally important part of the installation is the Grub Boot Loader. Since we are relying on rEFIt to dual-boot, we need to ensure that Grub does not intrude and writes itself in the Master Boot Record (MBR). Instead, ensure that Grub is only installed to the Root partition (/dev/sda3 and NOT to MBR). Further, ensure the "Write generic Boot Code to MBR" is UNChecked so nothing gets written to the MBR.



The rest of the installation is a non-event.


Cannot boot up openSUSE without the DVD loaded?

There is a chance, post-installation, that you realized that you can boot into Mac OS X but when you select to boot into Linux, your openSUSE 11.3 does not boot up and some vague error message like no operating system found. However, you are able to boot from the openSUSE 11.3 installation DVD and choosing to boot from hard disk instead, you can successfully boot up the installed openSUSE 11.3.

If this is the case, its highly likely the GPT/MBR may be out of sync. To resolve this, boot into openSUSE 11.3 and first use fdisk -l to check that only the openSUSE partition is set to boot (see first screenshot below). Next, use parted to check that the boot flag only applies to the first partition (rEFIt) and nothing else (see second screenshot below).



Finally, double-check the Grub Boot Loader setup via YaST -> System -> Boot Loader and verify the settings are correct (compared to the screenshots in previous section above).


Conclusions (to be continued)

The vanilla openSUSE 11.3, will be 85-90% functional. Some important items that works out of the box:
  • Graphics card is detected and proper resolution rendered
  • Keyboard works (in general but you can specify Apple Macbook keyboard in the Control Panel to improve mappings)
  • Touchpad works (but I do find it a tad sensitive so you can adjust it under Control Panel) or plug in your favourite USB mouse
  • Disk and DVD drive works
  • iSight webcam works with Kopete
  • Ethernet (LAN port)
  • FireWire and USB ports
  • External display port
  • SD Card Reader
The following is a list of things that does not work right away but will require addition work (like installing additional software packages) to get going:
  • Wireless does not work as its a Broadcom chip. You will require a LAN cable (hey, at least networking works!) to retrieve and install the appropriate broadcom drivers.
  • Default open source nouveau driver works for the nVidia GeForce 320M graphics card but if you want 3D desktop effects, you will need to download and install the proprietary nVidia driver
  • Audio does not work but its more a configuration issue than driver issue
  • You cannot adjust the screen brightness or keyboard backlight. You will need to install additional drivers for this to work
I will be addressing these in Part 2 of my blog. Stay tuned. peace


On a Side Note

I'd like to share why I did not install SUSE Linux Enterprise Desktop (SLED) 11 SP1 or earlier version of openSUSE 11.2. I did attempt it and both SLED 11 SP1 and openSUSE 11.2 DVD boots up but fails to recognized the DVD drive after the installation kernel/initrd loads. It kinda hangs at loading udev. I'm too lazy to figure out which module I have to load by hand and since openSUSE 11.3 works, its good enough for me. senyum


Links/References to other related pages

General Guide & starting point - http://old-en.opensuse.org/OpenSUSE_on_a_Mac

star Alin Marin Elena's entry specific to my MacBook Pro (7,1) model and openSUSE 11.3 - http://alin.elenaworld.net/?p=921

Howto based on openSUSE 11.2 & older 2009 MacBook Pro model - http://forums.opensuse.org/english/information-new-users/unreviewed-how-faq/426413-how-install-opensuse-11-2-mid-2009-macbook-pro.html

Forum post on Grub & Booting issues - http://forums.opensuse.org/english/get-help-here/install-boot-login/430718-macbook-pro-grub-2.html#post2113355

openSUSE Forum is a great source of information and discussions - http://forums.opensuse.org/

2 comments:

  1. Hi, I just got a vanilla OpenSUSE 11.4 (64bit) working on the same MacBook 7,1 model. Everything you said here also applies equally to 11.4, the only minor difference I've noticed is that the F2 & F3 keyboard functions to change screen brightness work.

    ReplyDelete
  2. Thank you Shervin, glad to hear it's still as easy for 11.4. As we look forward to version 12.x, I'm happy to link this blog entry to any helpful soul's page with details, tips & tricks. It's my little contribution to help make openSUSE online knowledge easier to find/search.

    ReplyDelete