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:

Que tal testar o Mac OS/X num PC antes de comprar um computador Apple?

Olá discípulos!
Este post pretende ajudá-los na sua jornada pela instalação do seu Hackintosh multi-SO.
Eu mesmo instalei um e, fora o fato de não reconhecer a rede e o cartão de video (ao menos ainda), o Mac OSX/Leo4All está funcionando conforme esperado.
Para ajudá-los eu descreverei os passos que segui e o que funcionou para mim.

Passo 1 - escolher o hardware
Há cerca de um ano comprei um caríssimo* Sony Vaio e não via a hora do Windows 7 chegar. Isto porque esta máquina estava muito devagar para um hardware desta configuração e o Vista era uma nhaca... A primeira coisa que fiz então foi diminuir a partição do Windows Vista e instalar o Ubuntu como segundo S.O., e ele acabou sendo a opção mais veloz para trabalhar com o meu caríssimo notebook Sony Vaio . Bem, quando que o Win7 foi liberado eu já estava buscando conhecimento sobre como construir meu próprio Hackintosh e então decidi fazer um backup das minhas coisas e usar meu caríssimo Sony Vaio como cobaia.

*)Nota: Eu creio que todas as máquinas da Sony são mais caras do que merecem para a configuração apresentada. A Apple carrega bastante no preço de suas máquinas, mas ao comprar um Apple você também está comprando um estilo de vida e qualidade. Ao comprar um Sony você está comprando um computador qualquer vendido por uma marca mundial que carrega nos softwares proprietários, a ponto de torná-lo muito lento e dando esta sensação de ser muito caro. Além do mais, sua qualidade não é tão boa quando a da Apple. Por que então comprei um Sony? Bom, porque a configuração era melhor que o Apple da mesma faixa de preços e pensei que seu desempenho também seria melhor. Além disso, eu gostava da idéia de ter um Blu-Ray player sem ter que comprá-lo em separado... Grande erro!

Hardware

Notebook Sony Vaio FGN-FW270E com:

  • Processador Intel Core2 Duo P8400@2.26GHz

  • Blu-Ray/CD-DVD/RW

  • 3GB RAM

  • 320GB HD

  • Bluetooth

  • Webcam

  • Monitor wide 16,4" Full HD

  • Placa de vídeo ATI Radeon HD 3470

  • Rede sem fio Intel Wireless WiFi Link 5100AGN

  • Rede eternet Marvell 88E8055 PCI-E Gigabit

Software:
S.O. Original:

  • Windows Vista Home Premium em portugês


S.O.s que Instalei:

  • Windows 7

  • Linux Ubuntu 9.10 Karmic Koala

  • Mac OS/X Leo4All


Passo 2 - Planejando seu Hackintosh
Eu optei por ter o Ubuntu 9.10, o Windows 7 e o Leo4All (MacOsX) instalados na mesma máquina, assim poderia testar suas características num só computador e escolher qual atenderia melhor minhas necessidades.
Também defini que precisaria de mais espaço no HD para o Windows e o Mac do que para o Linux, então particionei meu HD de 320GB conforme abaixo:

  • Windows: 170GB

  • Linux: 50GB

  • Mac OS: 100GB


Passo 3 - instalando o Windows 7 e particionando o HD
É importante iniciar seu trabalho pela instalação do Windows 7 primeiro. Isto porquê ele cria duas partições: uma para restaurar o sistema e outra para o S.O. e isto pode interferir no particionamento do HD quando for instalar outros S.O.s. Na verdade esta interferência vai acontecer de qualquer modo, mas sugiro fazer assim pois lidei com isto por cinco vezes tentando ordens diferentes de instalação e, como eu disse antes, iria mostrar o que funcionou comigo...
Ao instalar o Win7 é importante selecionar a opção de instalação customizada para que você possa definir o tamanho apropriado para sua partição Windows. Terminou? Vamos para o próximo passo.

Nota: Mesmo sem ter testado eu acho que estes passos devem servir para o Windows Xp e o Vista.



Passo 4 - instalando o Leo4All
Se você não tem o DVD de instalação do Leo4All Mac OS/X então dá uma "googleada" por aí que vai achá-lo. Eu tive que fazer o download usando o uTorrent depois de encontrar algumas fontes de torrentz no Google. A bosta é que vem tudo picadinho, depois tem que descompactar e juntar numa única imagem ISO para daí poder usar sua ferramenta favorita e queimar a imagem ISO num disco DVD-R.
Para instalar o Leo4All eu sugiro que busque instruções espalhadas na Net. O melhor tutorial que achei pode ser encontrado aqui. Certifique-se de segui-lo passo a passo.


Passo 5 - instalando o Ubuntu 9.10
Se você ainda não tem o CD de instalação do Ubuntu 9.10 poderá fazer o download aqui e usar uma ferramenta qualquer para queimar a imagem ISO num disco CD-R.

Aviso: Tome cuidado. Ao instalar o Ubuntu o instalador tentará usar todo o disco. Você terá que escolher a opção que permite o particionamento do disco para poder escolher a partição onde quer instalá-lo.

A tabela de partições do meu disco ficou assim:

/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

Onde:

  • /dev/sda1 é a partição que o Win7 criou para recuperação
  • /dev/sda2 é a partição do Linux (Ubuntu)
  • /dev/sda3 é a partição do MAC OS/X (Leo4All)
  • /dev/sda4 é a partição de boot do Win7 e a única partição ativa

Como você pode notar a ordem das partições não coincide com a ordem das instalações. Isto ocorre após a instalação do Ubuntu e parece ter algo a ver com o Grub . Eu não sei porque isto acontece e nem me preocupei muito em sabê-lo.
Sugiro esta ordem de instalação porque ter todos os outros S.O.s instalados antes de instalar o Linux vai permitir ao Grub 2 (o gerenciador de boot do Ubuntu 9.10) reconhecer os S.O.s instalados no disco e configurar um aquivo grub.cfg para você. Isto vai lhe economizar algum tempo e chateação, especialmente se você não estiver tão familiarizado com os comandos do Grub 2, que é justamente o meu caso.


Passo 6 - configurando o Grub 2

Agora é hora de fazer o download do boot_v8, copiá-lo para o /boot e editar o /boot/grub/grub.cfg para podermos fazer nossos ajustes e habilitar multi-boot de Windows7, Mac OS e Linux. Você poderá encontrar o boot_v8 aqui.
Depois do download, descompactação e extração, copie o arquivo boot_v8 para o diretório /boot.
Desnecessário dizer que você tem que ser superusuário (root) para poder ajustar toda esta bagunça, certo? (Ah, então era por isto que eu estava recebendo erros!). A melhor maneira de fazê-lo é abrir um Terminal e digitar sudo -i para daí ter acesso ao Bash como root.
Agora, no prompt do Bash (#) digite:

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

Os comandos acima farão uma cópia do seu arquivo grub.cfg original e então poderemos iniciar a edição de um arquivo 40_custom para conter as personalizações que quisermos. Digite:

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

Aperte Shift+G para ir ao fim do arquivo e então aperte a tecla "o" para adicionar uma linha e entrar no modo de inserção. Então digite:

menuentry "Meu Hackintosh MAC OS/X boot_v8 em /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-
}

Atenção: Um erro muito comum que as pessoas cometem é apontar o número da partição (hd0, n) para o número da partição MAC OS nas duas primeiras linhas do bloco menuentry acima. Você está lidando com arquivos armazenados no Linux, numa partição Linux, portanto este tem que ser o número da sua partição Linux. O lugar correto para colocar o número da partição MAC OS é na linha do comando parttool terminando com boot+ no bloco menuentry do MAC OS/X. Outro erro comum é deixar mais de uma partição ativa. Bom, nem o Win7 nem o Darwin (gerenciador de boot do Mac OS) conseguem lidar com mais de uma partição ativa (isto deve ter algo a ver com a personalidade egoísta do Gates e do Jobs, eu acho). Certifique-se de usar o fdisk para deixar apenas uma partição ativa (eu deixei a minha sendo a do Win7). É uma boa prática inativar todas as partições inserindo uma linha para cada conforme abaixo. Verifique que cada uma delas termina com um - (menos) a não ser a desejada, que deve terminar com um + (mais). Se você quiser economizar tempo tentando descobrir porquê seu Windows não inicializa direito, então adicione estas linhas ao seu arquivo 40_custom também:

menuentry "Meu Windows 7 em /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
}

Nota: Recomendo fortemente que você já adicione as duas entradas no mesmo arquivo 40_custom. Isto fará com que o Grub exiba entradas duplicadas na tela de arranque mas você poderá facilmente removê-las comentando (você sabe: editando o arquivo /boot/grub/grub.cfg como root e inserindo um "#" na frente de cada entrada indesejada. Tenha o cuidado de comentar o bloco todo do menuentry até seu "}" correspondente. Para salvar e sair, pressione ESC:wq! seguido da tecla ENTER, se estiver usando o vi).

Agora você deve ter um arquivo 40_custom muito parecido com este:

#!/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 "Meu Hackintosh MAC OS/X boot_v8 em /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 "Meu Windows 7 em /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
}

Pressione ESC:wq! para salvar e sair do vi. De volta ao prompt do Bash digite:

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

e uma vez que a tela do Grub apareça você poderá escolher seu sistema operacional e aproveitar seu novíssimo computador multi-boot e multi-SO.
Aviso: alguns usuários experimentaram erros tipo partição Win7 não encontrada após instalar o Ubuntu ou vice-versa. Isto pode ser resolvido facilmente pela reinstalação do Win7 ou carregando pelo CD de instalação do Ubuntu e seguindo as instruções encontradas aqui.

Divirtam-se!

Mestre Lord Vulture

------------------------------------------------------------------------------------------------------------------------
Links úteis

Recovering Ubuntu After Installing Windows

Install Leopard - Leo4Allv3

Take a Mint after your Apple

Download do arquivo boot_v8


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

Tela do Grub 2 mostrando todos os S.O.s disponíveis no meu Sony Vaio. Note que, apesar da versão marcar 1.97, na prática trata-se já do beta do Grub 2:


Tela do Windows 7 no mesmo Sony Vaio:


Tela do Ubuntu no Sony Vaio:


Tela do Mac OS/X (Leo4All) no Sony Vaio. Só não funciona (ainda) a rede e a placa de alta resolução do vídeo: