Booting Windows, Linux, and OSX on your Mac (Without using Grub/Lilo to boot windows)
Posted by Ricky in Apple, Computers, Linux, Ubuntu, Uncategorized
This question gets asked a lot, especially since people are having non-functioning keyboards in Linux Bootloaders (Windows too). If you make room on your Intel Mac to boot Windows and Linux, most distros will now detect windows and add an entry to grub and/or lilo, and install the bootloader to the MBR (Master Boot Record) of your disk. This is ok on most PCs, as there is not normally any other way to choose which OS you want when booting up. However, most Mactel multibooters are using rEFIt to select the OS, and there is no need to use grub for anything but Linux (and hopefully, a EFI native bootloader will be available someday to replace that).
The way to get around this annoyance is to install your Linux bootloader to the root partition (or your /boot partition if you have one), and leave the normal Windows bootloader in the MBR. I use Ubuntu and Grub, and will focus there, but these general instructions should work for any system.
New Linux install
I am not going to detail the process to install Windows. There is more than one method, the easiest probably being to use Bootcamp.
Most Distros will allow you to edit where to install your bootloader somewhere. I use Ubuntu, so I want to let know know where to make this change when installing Ubuntu. After running the installer, creating your Linux partitions, etc, the last screen before it actually installs gives a summary of what you are going to do. There is a button in the corner labeled “Advanced” clicking on that will give you the opportunity to specify where to install grub. You will want to make sure you use the partition that is for your root filesystem (/). If you have created a separate /boot partition, you will want to install it there.
After you install the Linux OS system, and you reboot, there should be 3 icons in rEFIt. One for OSX, one for Windows, and one for Linux. Choosing the OSX or Windows icons will boot directly to that operating system, and choosing Linux, will start your chosen bootloader. If you don’t want to see the bootlaoder at all, then you can edit the config file to reduce the delay (although I would keep some sort of delay in case you needed to switch to another kernel or something.)
I’ve already messed up and installed to the MBR!
Put The Linux Bootloader in the Correct Location
Boot into your linux system (or if you are not able to boot linux, boot a live cd) and open a terminal. You will start the grub command line. You will need root permissions:
sudo grub
You will then be at the grub command line. You will then want to find where your grub config file is and such by issuing the command:
find /boot/grub/stage1
If that does not work, try this instead:
find /grub/stage1
This will return a harddrive/partition designation of the form (hdx,y), where x is the number of the hard drive, and y is the number of the partition. Grub counts from zero though, and doesn’t differentiate between hd and sd type hard drive designations. So, some examples of the normal /dev name and the grub name:
hda = (hd0)hda1 = (hd0,0)sdb1 = (hd1,0)sdf4 = (hd5,3)
NOTE, that on some systems, hda does not translate to (hd0) as expected for some reason. This is primarily evident on Mac Pros that have multiple hard drives. Be sure to try the find statements above first. (This is also seen in some machines where the CD/DVD drives are recognized as hda, hdb, etc.)
Using the result of the above information, you need to set the ‘root’ (where grub’s files are), then install grub to the appropriate location:
grub> root (hdX,Y)
grub> setup (hdX,Y)
grub> quit
Be sure you replace the X and Y with the correct numbers of your partition.
Fixing The Windows Bootloader (Replacing the MBR).
After that, your Linux bootloader is in the correct location, and we now need to fix the Windows bootloader. Fortunately, Microsoft gives you a tool to do this with each copy of windows. You will need to boot your Mac from your Windows install CD into the “Recovery Console”. Once you are at the prompt, simply run:
fixmbr
Now, you can reboot. You should have 3 icons in rEFIt, and each works as mentioned above!
Entries (RSS)
[...] http://www.rickycampbell.com/booting-windows-linux-and-osx-on-your-mac-without-using-grublilo-to-boo... [...]
Ricky,
Thanks for the quick response-sorry for the delay. I have had OSX, XP 32bit and Vista all running fine on separate drives in the past. The problems started when I formatted the Vista allocated drive and attempted to get Linux running. A simple install will boot off the Linux disk, but after restart, the black, no bootable drive screen comes up (when restarting without the disk). After that, Linux doesn’t show up in the Bootcamp window as Windows or otherwise. I have tried reinstalling Linux-grub seems to install, no problems shown, but still have this problem. reFIT installs with no menu and no obvious way to function. I am not sure how rEFIt or gptsync work or even what it means to sync the partition tables. Maybe that will shed some light. I will use your suggested links when I get a chance-I have very limited blocks of time at the moment-Thank you very much for your time and assistance.
yea that is definitely sounding like your partition tables got out of sync. you will need to use the gptsync tool on the partition you install Ubuntu to.
rEFIt sometimes doesn’t work by itself. There is a script ( /efi/refit/enable-always.sh ) that should get it to start working. Also, the newest Mac Pros may not have been working with rEFIt at all until the newest version came out a few days ago.
Hi Ricky,
Thanks for you work and energy posting this, it is appreciated.
I am attempting to triple boot OSX 10.5.6, Windows XP32sp2, and Ubuntu 8.04.2
This seems a great method, though I am new to this and have only skimmed about 30 different threads and spent about 30 hours dealing with it. I do have a couple of questions. Please bear with me, I am not an IT guy-can only deal with simple command lines,etc. I just want to run a nice clean 64bit system for Maya and Nuke and am very anxious to avoid Vista.
My system is Mac 2X2.8GHz Quad-Core Intel Xeon with 10 GB ram. I am running Leopard on a drive in 1 bay and want to keep it that way. I want to run XP32sp2 for testing (Apple claims XP64 and 2000 are incompatible), and Linux Ubuntu in separate bays.
After many attempts unsuccessfully installing ubuntu and grub separately, etc, I have not achieved any bootable Ubuntu. Blinking black no bootable system. Difficult and time consuming to get back to OSX.
I also looked at rEfit. It doesn’t appear to work properly in Leopard, which I heard was a problem somewhere else.
I would prefer to keep Windows, OSX, and Linux on separate drives. I have 3 internals for this, but at certain points the installers leave unremovable partitions in various places, which seems bad because I guess these are left over from unsuccessful installs and I can’t get rid of them.
Thanks very much for reading this, if you have gotten this far. Is there hope for me? I would be very grateful.
Paul
Paul,
rEFIt should work fine for you. Can you describe the issue you are having with it?
I would probably get OSX and Windows working first… especially since you are going to be using separate drives. This should be pretty easy to get working since Apple makes it so easy with Bootcamp. Following that, I would disconnect the drives that you do not what the Ubuntu installer to touch (everything but the hard drive you intend to install to) and install to that. You can then use rEFIt or the gptsync tool in Ubuntu to sync the partition tables after the install, it should boot up. After that, you can add the other drives back into the mix and debug any further problems (which I bet you will have because of the multi drive issue that tends to crop up for the Mac Pro users).
I and other users have written quite a bit of documentation for this at :
https://wiki.ubuntu.com/MactelSupportTeam/CommunityHelpPages
and especially at:
https://help.ubuntu.com/community/MactelSupportTeam/AppleIntelInstallation
I know that it is bit a lacking for the Mac Pros (there are not a lot of Ubuntu users out there with them), but that ought to get you started. Also, you may benefit from some better help in the Apple Users forum at ubuntuforums.org
[...] My heartfelt thanks go out to the people responsible for this page, and this one, and of course this one too. These pages have helped me configure the audio, WiFi, video, and other components that [...]