Hackintosh- replacing an iMac

I generally use linux as my development environment and use OSX for everything else- all of my Mac hardware has always had issues running Eclipse- whether it is Java that is the memory and CPU hog or it is compiling all the dependencies for FFmpeg, I just have not found OSX to be suitable for my main development needs (though I do mange on my laptop).

Moving my office back home this month, I realized I would be faced with four monitors on my desk, something akin to having having a serious mission control look, which while amusing, feels way over the top for me. So I started scheming about how to just keep two monitors while having OSX for my daily tasks and linux for my work.
I contemplated doing a a dual dvi KVM switch with a USB video card for my laptop, but two problems arose with this- one, I use a bluetooth keyboard and mouse, which can only pair with one machine at a time, making the switch back and forth challenging, two, this was going to cost upwards of $400 US which I was not really prepared to spend.

So I started looking at my little linux box (Shuttle SD31G2) which has a decent amount of ram and a solid quad core processor. Digging around the forum.insanelymac.com site, it was quickly apparent that it was likely that I could run OSX on the affectionately named toaster. My low level goal is to just have a dual system setup where I can boot between drives. Beyond this I hope to be able to boot linux from Parallels while in OSX. I wanted a machine that was faster than my aging iMac which has had strange speed issues that a system reinstall did not fix, one that could run my linux development environment, reduce the amount of computers and monitors sitting on my desk, and generally be quiet- one of the best qualities of the iMac. If I was successful, I wanted the toastertosh to be as transparent as possible- it should act and behave as a mac. This means wireless, graphics, usb, ethernet, bluetooth etc.

What I used:

  • osx86tools
  • boot 1-2-3
  • EFI boot loader
  • Retail Leopard disk
  • some additional kexts for audio, video, and ethernet depending on your setup. I used:
    • Video NVidia installer **UPDATE:** just using EFI strings from osX86tools now
    • Realtec Audio by using the driver download from osx86tools (more below) along with the HDA Updater (updater) and the correct driver information from here.
    • Ethernet was a bit more tricky. See below.

I used this as my primary guide and this to help with some issues. Most of what I've done at this point was trial and error, but I've got a stable system that does pretty much everything I need.
I removed my video card for the install as it seemed to created difficulty for the installer. Since my motherboard had built in Intel GMA, this was not a problem.
Step 1: Install

  • Boot from the boot 1-2-3 disk
  • Swap to the retail Leopard disk 
  • Format drive as GUID, OS X journaled
  • Install OS X
  • Reboot

Step 2: Boot partition

  • Follow Munky's instructions for creating the EFI partition. This was the most important part for me as I wanted everything to boot cleanly. It will also allow for storing all the kexts outside of your extensions folder, making updates much cleaner.
  • Once you have the EFI partition mounted, mount your boot 1-2-3 disk, then mount the intrid.iso which is on the boot 1-2-3 disk. Now copy the kexts from the intrid.iso into your /Volumes/EFI/Extensions folder. This should give you a bootable EFI partition.
  • create an com.apple.Boot.plist (copy over /Library/Preferences/SystemConfiguration/com.apple.Boot.plist to /Volumes/EFI/)

if you want to auto boot, you need to add a string to the kernel flags item in the com.apple.Boot.plist file. You can use the disk label or the uuid of the disk. Popular wisdom seems to suggest using uuid for the disk, you can get the uuid by: #diskutil info /Volumes/DISK_NAME
It is easy to use osx86tools to then add this string to the com.apple.Boot.pilst- you should have something that looks like: boot-uuid=C8A8588E-133F-3958-9AF5-727399F78C2D in the kernel flags area in osx86tools.

  • Reboot
  • Update system to 10.5.5
  • Reboot

Step 3: Customize

  • Backup your extensions folder. Use the osx86tools Backup Extensions option to keep a clean set of extensions. This is really helpful if you have to do lots of testing with kexts. It will also be helpful for figuring out how to keep your system clean.
  • Install video drivers. In my case, the NVidia install was simple and fast. I also used os86tools to add an EFI string with my card information to the com.apple.Boot.plist. Note that you'll have to merge this into your com.apple.Boot.plist on your EFI partition. Do this for two reasons- one, apparently this makes the hardware detection cleaner and two, when you do a system update from apple, your customizations will not be wiped out.
    **UPDATE:** just using EFI strings from osX86tools now
  • Shutdown
  • Install NVidia card
  • Reboot
  • I downloaded the hardware drivers with osx86tools for my onboard audio card. Used kext helper to install them. I then used the AppleHDAPatcher with the right driver information for my card to patch the kexts I just installed.
  • I removed the AppleAzaliaAudio.kext on /Volumes/EFI which prevented my audio patches from working.
  • I used the driver from osx86tools with no luck, so I tried editing the Yukon.kext with the information provided here which also didn't work- because, from what I can tell, the extension that Apple is now using is: /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleYukon2.kext/Contents/Info.plist, (found here). Followed the same steps, but on this file instead of the Yukon2.plist. I also added ethernet to my com.apple.Boot.plist which allowed the network to come up immediately when I saved the plist file.
  • Time Machine: For what ever reason, Time Machine is sensitive to your network configuration. I messed around with a bunch of stuff before I used this IONetworkingFamily.kext. I reapplied my changes for the AppleYukon.kext (ethernet) after I had installed this.
    UPDATE: It seems that this replacement kext actually breaks things- I started having crashes and boot issues- I'm accepting that Time Machine is broken for now.

Next Steps:

  • I need to do a real diff between my original backup of my Extensions folder and move all the modified kexts into my /Volumes/EFI partition.

Some thoughts:

  • This was more complicated then it was cracked up to be- largely because each machine is different and the files needed for the motherboard and associated hardware are tricky to track down. One has to read many a forum post to find out what files and what techniques are needed to get things working.
  • While everything seems to work right, and xbench is reporting decent scores, there are moments where I wonder if things are working "right"- for example, mounting one of my other machines takes quite a bit of time. I'm unclear if this is my other machines or the toastertosh

Ultimately, it works, seems fast, and though I'm sure that there will be hiccups, I'm interested in trying this setup out. I'm typing on it now with no problems, so for the meantime, it is a happy thing.

There is a post that covers this over at insanelymac: Shuttle SG31G2 Install Guide

EPOS I. = EFI Post Install Script

it automatizes all of Munky's steps. Find it here: http://news.metaparadigma.de/?p=1706

enjoy...