domingo, 7 de fevereiro de 2010

What about giving Mac OS/X a trial in a PC before buying your Apple Computer?


Hello pupils!

Once much of the material I studied to build my own Hackintosh was written in English I decided to post this tutorial in Shakespeare's language as well.
This post is intended to help you in your quest for installing your own multi-OS Hackintosh.
I have installed one myselft and, despite the lack of networking and video card (so far) Mac OSX/Leo4All is working as expected.
In order to help you I'll describe the steps I followed and what have worked for me.

Step 1 - pick your hardware
One year ago I bought an expensive* Sony Vaio and was looking forward for Windows 7 to come. Thats because this computer was running so slow for such configuration and Vista really sucks... The first thing I did was shrink Windows Vista's partition and have Ubuntu installed as a second O.S.. As a result it ended up as the fastest option to work with may expensive Sony Vaio notebook. Well, when Win7 was released I was searching for knowledge about building my own Hackintosh already, so I decided to back my stuff up and use my expensive Sony Vaio for the experiment.

*)Note: I believe that all Sony computers are more expensive than they deserved to be for such configuration. Apple does charge it's price a lot but when you buy an Apple computer you also are getting lifestyle and quality. By purchasing a Sony you are buying an ordinary computer sold by a global brand that carries proprietary software so much that ends up slowing the computer down, giving you the sensation of having paid so much for so little performance. Besides, it's quality isn't as good as Apple's. Why didn't I purchase a Mac instead of a Sony? Well, Sony's configuration looked superior than the same priced Mac and I thougth its performance was superior as well. Besides, I liked the idea of having a Blu-Ray player without having to buy it separately... Big mistake!

Hardware

Sony Vaio FGN-FW270E notebook with:

  • Intel Core2 Duo P8400@2.26GHz Processor

  • Blu-Ray/CD-DVD/RW

  • 3GB RAM

  • 320GB HD

  • Bluetooth

  • Webcam

  • Full HD 16,4" Wide Display

  • ATI Radeon HD 3470 Video Card

  • Intel Wireless WiFi Link 5100AGN

  • Marvell 88E8055 PCI-E Gigabit Ethernet Card

Software:
Original O.S.:

  • Windows Vista Home Premium in portuguese


O.S.s I Installed:

  • Windows 7

  • Linux Ubuntu 9.10 Karmic Koala

  • Mac OS/X Leo4All


Step 2 - Planning your Hackintosh
I choose for having Ubuntu 9.10, Windows 7 and Leo4All (MacOsX) installed on the same machine so I could test their features in a single computer and make a better choice on which one would better fulfill my needing.
Also, I decided that I'll need more HD space for Windows and Mac OS/X than for Linux so I sliced my 320GB HD as follows:

  • Windows: 170GB

  • Linux: 50GB

  • Mac OS: 100GB


Step 3 - installing Windows 7 and partitioning the HD
It's important to start your task by installing Windows 7 first. This is because it creates two partitions: one for system restore and other for the O.S. itself and that could interfere in the partition table when you install other O.S.s. In fact this kind of interference will happen anyway but I suggest you to follow this sequence anyway. I dealt with it for 5 times trying different installation sequences and, as I said, I'll show what worked for me...
During Win7 installation it is important to select the customized installation option so you can choose the right disk size for your Windows partition. Finished? Let's go to the next step.

Note: Even having not tried it myself, I believe this will work for Windows XP and Vista.


Step 4 - installing Leo4All
If you don't have the Leo4All hacked Mac OS/X installation disk then do some googling around and you'll find it. I had to download it using uTorrent after finding some torrentz sources at Google. The annoying part is that it comes in slices; you have to decompress it and join it in a single ISO image. Then you can use your favorite tool to burn the ISO image in a DVD-R disk.
For the Leo4All installation I suggest you to look for instructions spread all over the web. The best tutorial I saw can be found here. Be sure to follow it step by step.


Step 5 - installing Ubuntu 9.10
If you still don't have the Ubuntu 9.10 installation CD you can download it here and use any disk burning tool to burn the ISO image onto a CD-R.

Warning: You have to be careful. During installation Ubuntu will try to use the entire disk space, not only the remaining unused partitions. You will have to choose the option that enables disk partitioning in order to install it in the desired partition.

My HD partition table looks like this:

/dev/sda1        1      13      102400  7 HPFS ou NTFS
/dev/sda2 13 6328 50725888 83 Linux
/dev/sda3 6329 18486 97659135 af HFS / HFS+
/dev/sda4 * 18487 38914 164080640 7 HPFS ou NTFS

where:

  • /dev/sda1 is the restore partition created by Win7
  • /dev/sda2 is the Linux (Ubuntu) partition
  • /dev/sda3 is the MAC OS/X (Leo4All) partition
  • /dev/sda4 is the Win7 boot partition and the only active partition

As you can see the partition sequence shown does not match the installation sequence. This happens after installing Ubuntu and seems to have something to do with Grub. I don't know why that happens, but it doesn't bother me much.
I suggest this installation sequence because after having all other O.S.s installed before you install Linux will enable Grub 2 (Ubuntu's 9.10 boot manager) to discover them and set a grub.cfg up for you. This can save you time, specially if you are not quite familiar with Grub 2 commands, which is precisely my case.


Step 6 - configuring Grub 2

Now it is time to download boot_v8, copy it to /boot and edit /boot/grub/grub.cfg so we can do all the necessary adjustments and enable multi-booting Windows7, Mac OS and Linux. You can find boot_v8 here.
After the process of downloading, decompressing and extracting the files copy the file named boot_v8 to the /boot directory.
It is unnecessary to say that you have to be super user (root) in order to fix all this mess up, right? (Uh, so this was why I was getting some error messages, uh!). The best way to do it is opening a Terminal window and typing sudo -i to get access to a Bash prompt as root.
Now, at the Bash (#) prompt type:

# cd /boot/grub
# cp grub.cfg /root/grub.cfg_original_backup

The commands above will make a copy of your original grub.cfg file and then we can start editing a 40_custom file that will contain all the customization we are want. Type:

# cd /etc/grub.d
# vi 40_custom

Press Shift+G to go to the end of the file and then press the "o" key to add a line and get into insert mode. Then type:

menuentry "My Hackintosh MAC OS/X v8 on /dev/sda3" {
multiboot (hd0,2)/boot/boot_v8
module (hd0,2)/boot/grub/hfsplus.mod
parttool (hd0,1) boot-
parttool (hd0,2) boot-
parttool (hd0,3) boot+
parttool (hd0,4) boot-
}

Attention: A very common mistake people do is to set up the partition number at (hd0, n) to the MAC OS partition number in the first two lines of the menuentry block above. You are dealing with Linux files, stored in a Linux partition, so this number must match your Linux partition number. The right place to put your MAC OS partition number is at the parttool command line ending with boot+ in the menuentry block for MAC OS/X. Another common mistake is to leave more than one active partition. Well, neither Win7 nor Darwin (Mac OS boot manager) can deal with more than one active partition (this must have something to do with Gates and Jobs selfish personality, I guess). So be sure to use fdisk and leave only one active partition (I always leave it as being Win7's one). It's a good practice inactivate all other partitions but the desired one, as seen bellow. Note that each one of them ends up with a - (minus) but the desired one, which has to end up with a + (plus). If you want to save time trying to figure out why Windows does not start proper then add these lines to your 40_custom file as well:

menuentry "My Windows 7 on /dev/sda4" {
saved_entry=${chosen}
save_env saved_entry
insmod ntfs
set root=(hd0,4)
search --no-floppy --fs-uuid --set 6e02ab2702aaf2ef
parttool (hd0,1) boot-
parttool (hd0,2) boot-
parttool (hd0,3) boot-
parttool (hd0,4) boot+
chainloader +1
}

Note: I strongly recommend that you add both entries at once to the 40_custom file. This will make Grub to show some duplicated entries that you can easily remove by commenting the undesired blocks (you know: editing /boot/grub/grub.cfg as root and inserting a "#" in the beginning of each undesired entry. Be careful to comment the entire block, from the menuentry until it's corresponding "}". To save and exit press ESC:wq! followed by ENTER).

Now you should have a 40_custom file that looks pretty much like this:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "My Hackintosh MAC OS/X boot_v8 (on /dev/sda3)" {
multiboot (hd0,2)/boot/boot_v8
module (hd0,2)/boot/grub/hfsplus.mod
parttool (hd0,1) boot-
parttool (hd0,2) boot-
parttool (hd0,3) boot+
parttool (hd0,4) boot-
}

menuentry "My Windows 7 (loader) (on /dev/sda4)" {
saved_entry=${chosen}
save_env saved_entry
insmod ntfs
set root=(hd0,4)
search --no-floppy --fs-uuid --set 6e02ab2702aaf2ef
parttool (hd0,1) boot-
parttool (hd0,2) boot-
parttool (hd0,3) boot-
parttool (hd0,4) boot+
chainloader +1
}

Press ESC:wq! to save and exit from the vi editor. Back to the Bash prompt type:

# grub-install /dev/sda
# sync
# reboot

Once Grub screen shows up you will be able to choose your operating system and enjoy your brand new multi-boot multi-OS computer.

Notice: some users experimented Win7 partition not found errors after installing Ubuntu or vice-versa. This can be easily solved by re-installing Win7 or booting up via Ubuntu's installation CD and following instructions found here.

Have fun!

Professor Lord Vulture, PhD/MMVP/LMVP/MCP/LCP/APR

------------------------------------------------------------------------------------------------------------------------
Useful Links

Recovering Ubuntu After Installing Windows

Install Leopard - Leo4Allv3

Take a Mint after your Apple

Download of boot_v8 file


------------------------------------------------------------------------------------------------------------------------
Screenshots

Grub 2 screenshot showing all O.S.s in my Sony Vaio computer. Note that besides showing 1.97 version it's already beta of Grub 2:


Screenshot of Windows 7 in the same Sony Vaio:


Ubuntu as it shows in Sony Vaio:


Mac OS/X (Leo4All) in Sony Vaio. The only thing that does not work (yet) is the network and the hi-res video card:

Nenhum comentário: