Apple Mac OS X 10.7.22012-01-30
With my Mac Mini dead, I was once again left without a running OS X install. Back to the trusty Hackintosh! Despite having been run 24/7 for nearly four years first as a Hackintosh, and then as a media server, this computer has remained faultless. That's three times longer than my Mac Mini lived for, for those counting.
But re-installing 10.5.2 seems so ... antiquated. Time to install Lion! I'll recount the difficulties encountered, how I overcame them, and list my step-by-step setup and installation guide.
First problem: installation
So, OS X Lion is distributed as DMG files. Both the pre-made, hacked-up versions; and the official version from the App Store. Great thinking on the Hackintosh folks' side: let's require OS X to install OS X. Of course, if you had OS X, you probably wouldn't be that interested in installing it in the first place ...
So the easiest way to get started is to find a friend with a Mac, who will let you run strange hacking programs on his expensive computer. Failing that, you have two fun options.
The first is to download VMware Workstation 7.1.3, get it registered (use your imagination), find the hack to enable OS X support for it on Windows and Linux clients, find a pre-made vmdk image file of OS X Lion, and install and use that.
The second option, which I took, was to reload OS X 10.5.2, and use this to create the installation drive. In this case, you want the official ~3.5GB "Install Mac OS X.app" file from the App Store (again, use your imagination.)
And here comes the fun part: all the tools that make this easy for you (myHack, Unibeast) only run on Snow Leopard or above. Why? Who knows. But that's fine: I want the most pristene installation I can get, so the more silly programs (that hack up my OS with their little graphic replacements and unnecessary hacked kernel extensions) I can avoid, the better.
Second problem: creating the installation media
It's tricky, I'll just paste my notes here. You'll need a USB hard drive, and the aforementioned official App Store download.
[create OS X Lion installation hard disk] Mount "Mac OS X.dmg" Copy "Install Mac OS X Lion.app" Show contents of "Install Mac OS X Lion.app" Go to Contents/SharedSupport Mount "InstallESD.dmg" Show hidden files in Finder :: defaults write com.apple.Finder AppleShowAllFiles TRUE :: killall Finder Mount "BaseSystem.dmg" from inside "InstallESD.dmg" Launch Utilities -> Disk Utility Partition USB HDD with two partitions: :: GUID partition table :: Mac OS Extended (Journaled) :: Partition 1: "Chameleon" 1GB :: Partition 2: "OS X Lion Installer" 8GB+ Install Chameleon v2.1-svn r1806 to "Chameleon" :: Change install location to "Chameleon" :: Customize :: Add "Standard" theme :: Install Open "Chameleon", go into Extra folder Copy all files from "GA-945GCM-S2C.zip" to this folder :: DSDT.aml, smbios.plist, org.chameleon.Boot.plist, Extensions/ From Disk Utility, choose "Mac OS X Base System" (already mounted earlier) Choose Restore tab Set destination to OS X Lion Installer Click Restore :: This renames "OS X Lion Installer" to "Mac OS X Base System" :: The DMG mounted earlier shares the name, so be sure to target the USB version after this point Copy "mach_kernel" from "Mac OS X Install ESD" to "Mac OS X Base System" Go to "Mac OS X Base System/System/Installation" Delete "Packages" link Copy "Mac OS X Install ESD/Packages" to "Mac OS X Base System/System/Installation" Eject both USB partitions
[boot OS X Lion installation hard disk] Press F12 during bootup to access boot menu Choose Hard Disk Choose USB-HDD0 Choose "Mac OS X Base System" Choose Utilities -> Disk Utility Partition internal hard drive: :: GUID partition table :: Mac OS Extended (Journaled) :: "OS X Lion" 8GB+ Install to "OS X Lion"
In your case, you'll need to find your own DSDT.aml and Extensions/ folder that works for your specific board. Search around on the various Hackintosh sites and see what you can find.
In my case, my extensions are: AHCIPortInjector, AppleRTL8169Ethernet, FakeSMC, IOAHCIBlockStorageInjector.
Third problem: "[ PCI configuration begin ]"
If you boot and it freezes before starting the installer, try again with the "-v" flag for verbose mode at the boot options screen in Chameleon. You should really just use verbose mode regardless until you are able to run OS X normally.
If you see that it gets stuck at "[ PCI configuration begin ]", the easy fix is to add the boot flag "npci=0x2000". I don't really understand what it does, but who really cares? It works.
Fourth problem: "PCI Parity Error !"
If you don't use verbose mode, this may just look like a kernel panic.
So now the OS X installer is bailing out partway through with this message. Or if you're really lucky, you got OS X installed, and it keeps crashing frequently with this message.
I had to figure this one out myself through trial and error: turns out, it didn't like me having two RAM sticks. Parity usually refers to ECC's superior, which is an odd thing for a non-server PC to be using. But whatever. Take out one RAM stick, and only use one big one. The problem goes away. Leopard doesn't need this, but Snow Leopard and Lion certainly do, at least for me.
Fifth problem: frequent bizarre kernel crashes
If you're using VoodooHDA for your onboard HDA audio: don't. It's a lovely idea, but this driver is notoriously unstable. Go to the store, and buy yourself a $30 Sound Blaster X-Fi Go! Pro USB sound card. You'll be glad you did. It works out of the box, no drivers need to be installed, and it's one less third-party driver. One step closer to a pure install, one less source of headaches. Creative says it doesn't work with OS X, because I guess they don't like money from Apple users. But it does in fact work.
Sixth problem: video acceleration doesn't work
Easiest way is to just keep buying cheap graphics cards until one works.
Intel GMA950 only works in 32-bit mode, so you have to boot with arch=i386 to use it. Apple left owners of older Mac Minis out to dry here. Surprise, surprise.
I don't know about AMD, I do my best not to buy ATI products.
nVidia ... well, Leopard had no problem with 8400 GS cards. I went through three of them that didn't work at all on Lion. Even despite the fact that the hardware compatibility lists said my exact models did. Oh well. I finally found a Gigabyte GT 210 1GB DDR3 card that did the trick. Works, and I only have to pass "GraphicsEnabler=Yes" to the boot loader.
Seventh problem: video is distorted and shifted
This is a common problem I've faced with my monitor. If your monitor only has an HDMI input, and you connect it via HDMI to DVI cable, and you use an nVidia graphics card, you may get hit by this.
You basically have to rewrite your monitor's EDID, because on OS X there is no possible way to override it via software. NVDAResman fetches it right from the monitor, and good luck hacking a closed-source binary blob.
In my case, I had to take my monitor apart and physically disable the write protection on the EEPROM that stored the EDID information, learn the EDID file format, dump what was there, hand-modify it to disable the CEA extension that contained the HDMI TV modes that nVidia was picking up (and subsequently forcing TV mode filtering on), and flash the new EDID binary using a DOS utility in an old computer with an older 8400 GS video card. Fun times!!
You can read more about that here, if you're interested.
Updating to 10.7.2 and installing the Chameleon bootloader
So we want to upgrade the 10.7.0 release to the latest official release. Apple doesn't do cumulative updates, so you have to install 10.7.1 first, and then 10.7.2, and then ... pray you don't ever reach 10.7.8 and need to do a reinstall, I guess.
Once done, we don't want to have to keep booting off the USB drive. So we install Chameleon directly to the internal hard drive, thus completing our Hackintosh Lion install:
[setup OS X Lion] Boot from USB hard disk (bootloader is not yet installed otherwise) Boot to "OS X Lion" Install OS X 10.7.1 update Reboot Boot from USB hard disk Boot to "OS X Lion" Install OS X 10.7.2 update Reboot Boot from USB hard disk Boot to "OS X Lion" Install Chameleon v2.1-svn r1806 to "OS X Lion" :: Customize to install standard bootloader and standard theme Extract GA-945GCM-S2C.zip Copy all files inside "GA-045GCM-S2C/Extra" to "OS X Lion/Extra" Unmount and eject USB hard drive Reboot
And some handy commands, in case you want them:
[install/modify kexts in /System/Library/Extensions] sudo chown -R root:wheel /System/Library/Extensions sudo chmod -R 755 /System/Library/Extensions sudo kextcache -system-prelinked-kernel sudo kextcache -system-caches :: fix ownership error with sudo kextcache -system-caches sudo chown root:admin /
You really shouldn't install extensions to /System/Library/Extensions, though. They work just fine in your /Extra folder for Chameleon. And you don't have to mess with the above.
Conclusion
So there we go. The OS install took me three days, and the monitor hacking took me an additional two days. They say that time is money, but at this point, I'm happy to spend all the time needed to make sure Apple never sees one more dime from me. So I know you're asking, "why go to all the trouble for a Hackintosh then?"; well, I'm a software developer, and cross-platform development is something I care about. Since OS X has four times the market share of Linux, that doesn't give me much choice.
So ... in the end, I have a 100% fully functional Lion install. Fantastic!