I recently picked up a MacBook Pro. It is a okish laptop, its main problem is that it is a Mac and that it doesn’t have a decent video resolution, it is like 1440×900. Still apart form that it is a fairly nice laptop. I mainly picked it up as when I joined Qantm Collage they had some deal with Apple and I was able to get this Laptop very cheap. So I thought… hey I’m doing programming this way I will in fact have a mac and therefore be able to develop Mac and iPhone/iPad applications.

Anyway. I had such a terrible time getting my Mac setup and working that I thought I would make a short tutorial on how to get the Mac setup. Mainly so if I screw it up I can do it all again.

Some Basic Boot Tips

When getting your MacBook running smoothly there are some basic tips you might want to remember about how it boots. These will help you in future.

  1. Hold down C during boot will force the MB to boot from the DvD drive
  2. Hold down OPTION during boot will take you to the default MB partition loading menu
  3. Hold down COMMAND + R to load into recovery mode. This one is important. If you screw up you can always reinstall the OS form the internet. The command will even load the boot partition from the internet, so if you (like I did a few times) delete or break your recovery partition you can still recover. This is a nice feature.
  4. The mac OS I am using is called LION. Now I have always hated the yway OS guys name OSs. Even the uBuntu guys do this and it is fucking retarded. To this day I am not 100% sure what lion is.. but I am pretty sure it is MacOS 10.x or somthing. While logged in on your Mac you can clikc the apple icon and “about this mac” and it will show you the VERSION number.. then you will need to google to find out what your version is called. I couldn’t find any other way.

Ok lets get this started!!

STEP 01 – iREFit – Alternative Mac Boot Loader.

Ok we have a nice neat MB… first thing we want to do is replace the lame partition boot loader Apple uses with something a little more useful. We will be suing iREFit (iRefit) I could go into detail about how the Mac partitioning works.. but it is fucking retarded and really flaky. If you are interested in the more techy crap about this read this page and either cry or laugh.. both are valid responses to how Apple handles this

iREFit

This is what we are going for, a triple boot of Lion (that is the Mac OS I am currently using), Windows 7 and Ubuntu.

Now, iREFit is easy to get working.. just go to the iREFit weboage and download the files onto your mac and follow the MANUAL install instructions. At this time iREFit 0.14 installer will not work, at least I couldn’t get it to.

So follow the Manual install instructions for iREFit and when you next boot you should be greeted with the iREFit boot menu.

IMPORTANT

You want to sync the partition information at this point. So form the iREFit menu simple highlight the Partition Tool icon and load it and it will auto sync for you and do much of the hellish fdisk commands for you to sync the automatically syncing the boot tables.

STEP 02 – Partitioning

The first thing we need to do is partition your Mac drive to allow you to install the other OSs. Now there is the Apple way of doing this and the correct way. Lets do the correct way so we will NOT be using bootcamp. So go to launch pad or w/e it is called and find DISK UTILITIES. Load it up and lets do it manually.

Disk UTILITIES

Now this is pretty strait forward. Simple click on the drive itself.. click on the Partition button and then click the + button until you have 4 drives. Format all the new drives as FAT (MSDOS) Resize them to what you would like. I only wanted to sue windows to get access to some apps I like (Visual Studio 2010) and possibly some games so I gave win7 a 150 GB partition. I gave Linux a 250GB partition and you also need to make a linux swap drive. This should be a minimum of 2 gigs but it is bets for it to be around the same your ram. I have 4 gig of ram so I made the swap drive 3.5GB. This left me with about 500GB for mac I think. Do not worry about this to much as when we are done each OS will be able to access the other drives anyway. Many people prefer to have small OS drives and then a single large shared data drive (5 partitions) but I just prefer my way .. so what .. wana fight about it?

Do not be scared this is a non destructive process. It is very simple.. click the + button 4 times. Set the new partitions to FAT(MSDos) and remember to NAME them.. mine are simple Mac, Windows, Ubuntu, UbuntuSwap. After you have done that.. make sure you take note of the partition IDs. it should be something like Disk2 – 6. To find these if you can not see on the left click on each disk and hit the INFO button. It isn’t hard to remember.. Mac Os on disk2, the boot information is on disk 1 (hidden by Apple) and disk 3 is the recovery partition (also hidden) so Windows is Disk 4 and Ubuntu will be disk5 and the swap will be disk6.

Ok that is it.. lets install this crap…

Oh wait b4 we do that.. grab a USB stick and pop it in the drive and then go to BOOTCAMP and use it to download onto the USB stick the apple drivers for windows 7. So just tick the 2nd option “Download Latest Windows 7 software form Apple” and follow the on-screen instructions to save it to your USB

Ok so that is all done. Lets install Windows!

STEP 03 – Installing Windows

Put in your windows 7 install disk and reboot your MB. Hold down “c” while it is booting and it should force it to load form the DvD drive. (OMG you know how long this took me to find out how to do!) The windows 7 install thing-o will pop up and choose “CUSTOM INSTALL

You will be presented with windows lame way of displaying the the partition information by NOT showing the actual partition IDs. You might note that the OS is saying you can not install on ANY of these partitions.. that is fine. If your lucky and have the service pack version of the win7 installer you will see your volume names .. simply high light the one that you named WINDOWS.. if you are like 98% of the earth and have the original win7 installer this information will not be here and Microsfot hides the fucking disk IDs.. not to worry you should see the data type.. in this case we formatted the partition in the Mac OS as FAT. so you should see 3 partition you do nto want to fuck with then 3 fat partitions.. click the 1st one.. it should be the WINDOWS one we set up if you followed my instructions.

Click FORMAT and now you should be able to install. Simply follow the win7 install instructions and all should be good. Once you get into win7 make sure you remember to install the software you saved to that USB.

Now when you boot iREFit should now show you anew Icon for win7.. awesome! But for now boot back into Lion.

STEP 04 – Installing Ubuntu

For those of you that do not know, Ubuntu is a linux distribution and is a 100% open source and free OS. It is also a fantastic OS and arguable much better than the big guns MS and Apple produce. God forbid that a usre might want to install one of the most powerful and customisable OSs available.. Apple do not support this in anyway.. in fact they have added hidden features specificity designed to block people from installing this.. so ti is a little more complex. I love Ubuntu and it is my mainly used OS of choice nowdays, with the win8 debacle it might be time for ubuntu to finally get more of a mainstream user base.

Anyway from LION (yes there is a reason we do this on the Mac OS.. you can download on windows if you like but easier to do it on Mac) go to the ubuntu website and download the latest 64bit desktop installer.

Leave that in the downloads dir but rename it to ubuntu.iso. Not strictly speaking needed but makes it a lot easier. To burn the disk simple load Disk Utilities, click the burn button select the iso and insert a CDr…

Now the tricky stuff. We can not just install the OS now as once we boot into the linux OS the apple dvd drive will stop functioning for a small time due to how Apple handles disk access on a hardware level. The reason win7 can load is that Apple have a deal with them and have built the hardware for it. This is a way of trying to force the consumer to not use “unapproved” OSs.

Anyway… we can get around it.. put a USB in your MB and in disk utilities erase it to MSDOS. Now, click on the USB drive itself.. NOT the partition and then click the INFO button. Take note of the disk identifier it will be like disk1 or 2 or w/e… either copy this to clipboard or write it down. Now click on the partition of the USB and click the unmount button.

now open a terminal and type in – dd if=~/Downloads/ubuntu.iso of=/dev/diskN bs=1m but replace diskN with the disk identifier you saw before. Use anything but disk0 as this is most likly your harddrive with the mac os and your windows installation on it. :)  Now what we are doing here is copying the ubuntu.iso from downloads to the USB in a way that it will make the USB identify as a CDdrive.

When you run the command the terminal will look like it has hung… this takes a while to do. Just give it time. If your USB has a light on it you should see it madly blinking. At the end it will print out a report on how much data was transferred.

Now we can reboot holding C to load from the ubuntu CD.. when the drive fails due the OS hardware, it will now automatically switch to the USB drive thinking it is in fact the CDdrive. Allowing the ubuntu install to continue. Neat!

STEP 05 – Ubuntu Installation

Now you should be seeing the “try ubuntu” or “install ubuntu” icons. Simply hit the install ubuntu select “SOMETHING ELSE” and follow the on screen instructions until you see a partition menu.

Now.. ubuntu like Lion dose show us the disk ids. So simply highlight /dev/sda5. You should see a lot of info here. I haven’t got screen shots.. but take some time to really look at the screen and you should see 2 MSdos partitions as windows has reformatted as NTFS. They are most likely after the  NTFS partition.. probably at 5 and 6. One small one bigger.

  • Click on the larger one (5) and click CHANGE set it to EXT4, tick the format button and set the mount point to /
  • Click the smaller one (6) and click on CHANGE set it to SWAP.

Probably silly thing to say.. but make sure you are not trying to install on the USB stick… I did this once and it was a pain to fix.. if you do.. reboot into the install and in the partition menu select the correct drives BUT make sure you delete the swap partition from the USB.

NOW ULTRA IMPORTANT OR YOU NEED TO START AGAIN You should see drop down at the bottom of the partition window concerning the about the “boot loader” YOU HAVE TO SET THIS TO THE SAME PARTITION YOU ARE INSTALLING IT ON. DO NOT LEAVE DEFAULT. if you do not see this, well you should but you can access this again latter at the overview b4 you commit by hitting the advanced button.

So just to restate.. make sure you set the BOOTLOADER to the same partition you are installing ubuntu on itself.

Ok.. that is it.. install and be happy!!

STEP 05 – Fix the Boot Partition (AGAIN!)

Right we are almost done!! You should be able to boot into mac, windows and linux.. though.. many people will find that selecting the linux icon will still boot them into windows. This is easy to fix.. so boot into your Mac and we will manually create the MBR booter ourselves.

  • Install gDisk
  • Load the mac terminal
  • type: sudo gdisk /dev/disk0
  • Press ‘r’ to repair and ‘o’ or ‘p’ to view the current partition information. What you should see is that the MBR is not matching the partitions we want to use… you may need to refer to these print outs.. so read them.
  • press “h” to build a new one.
  • Simply type in the disk numbers you wish to use for booting separated by a space.. nothing else no commas or anything. In my case it was “2 4 5″ Remember 1 is the boot partition itself, 2 is the mac os, 3 is the recovery disk. 4 is our windows install, 5 is ubuntu and 6 is the ubuntu swap. (assuming you followed my lame instructions)
  • Accept the default/recommended placement of EFI. This will add another partition to the selected three; hMBR has a maximum of 4. You can add the recovery disk as well.. but it is not needed.. you can still boot off it regardless. though the command+r boot hotkey i mentioned at the start.
  • Then for all the partitions but the ubuntu one.. select the defaults. For windows say YES to the BOOT question but for Mac say NO. If you added the recovery disk, say NO to that as well.. everything else default (just press enter)
  • for the linux install instead of default.. type in “83″ and select YES for boot.
  • ok your done.. hit “o” to verify and read it.. then “w” to write it out.

That is it.. you should now have a cool triple boot macbook running all the neat OSs on the market!!! Woot finally what  a cluster fuck… but worth it.. though I pretty much just use ubuntu it is cool having the other OSs.

STEP 06 – Ubuntu Fine Tuning

One problem for ubuntu with some users is that it is a little less friendly to setup, though once running it is sweet candy. You will notice some minor problems. like WIFI not working. This is fixable…1st just run the update manager and update everything

After reboot load a terminal and type these commands

  • sudo add-apt-repository ppa:mpodroid/mactel
  • sudo apt-get update
  • sudo apt-get install b43-fwcutter firmware-b43-installer

Now we just want to edit a text file and we are done… so type
sudo nano /etc/modprobe.d/blacklist.conf

and add the line: blacklist ndiswrapper

Then type
sudo nano /etc/pm/config.d/modules

and it will edit or create a file and add: SUSPEND_MODULES=”b43 bcma”

reboot and wifi will be working! There is a number of other cool things you can do to tweak your ubuntu experience … see this info page..

I recommend the trackpad tweak to get the same functionality in the tarckpad as in LION.

That is it… everything should be funky… have fun