Hackintosh Server

I’m now just under a week into the project, so it seemed like a good time to finally write this up.

I’ve had a Windows Home Server v1 box for over 4 years now, and it’s served me pretty well in that time. It’s a file share, it backs up the PC’s in my house, and I’ve tried to use it to run some programs 24/7 (mainly iTunes, but iTunes on a WHS box runs like a dog).

Sadly, Microsoft has decided that the WHS line doesn’t have a future, and WHS v2 got rid of the most compelling feature for me (that being it’s magical RAID-ish Drive Extender tech), so that didn’t seem like much of an option either.

My primary requirement for a home server is that it has to serve up files reliably, but beyond that I had a few other goals:

  • I’ve got more Apple devices than ever before (iPhones for me and the Mrs., Apple TV3, and an iPad 3), so being able to run iTunes 24/7 and auto-upload new tracks to iTunes Match would be really nice.
  • My WHS box ran JungleDisk (which uploads to S3) and backed my photos up, but frankly it was a little pricey compared to something like BackBlaze (not to mention that BackBlaze would backup more than just my photos). BackBlaze doesn’t run on Server 2003 or 08 (WHS v1 is built on 03 and v2 is built on 08), but ideally whatever I’m using for a server could run BackBlaze.
  • Last, but predictably not least, I wanted to try something different.

Oh, and one last requirement - I wanted to use as much of the existing server hardware as I possibly could. This eliminated buying a NAS, even though some of them (I’m looking at you Synology) are awfully nice. I seemed to have four options, in no particular order:

  1. Windows 7 - would satisfy my main goals (even though iTunes on Windows is still terrible and slow), but lets face it - I know Windows 7 pretty well. This option didn’t satisfy my inner nerd’s desire to try something new.
  2. Hackintosh (running 10.8 + Server.app) - okay now this option got my interest. It would definitely satisfy all of my requirements, plus give me a little bit of a challenge. The idea of having a faster iTunes experience was appealing as well.
  3. FreeNAS - another interesting option. Seemed to hit all of my requirements (with a plug-in handling iTunes support), but after doing some reading, it looks like iTunes support didn’t include iTunes Match. Oh well. First world problems, etc, etc.
  4. Ubuntu or some other Linux distro - unless I wanted to run iTunes in a VM, this wasn’t going to be that successful.

So I was really down to Windows 7 and a Mountain Lion-based Hackintosh, and if you read the title, you know how this ended up.

Hardware

I’d be remiss if I didn’t say that before I made my final decision, I did a lot of research and found out that my existing server hardware was pretty compatible with OS X. I knew I wanted to take advantage of falling SSD prices to grab a cheap boot drive, so I ended up with the following hardware:

  • Intel 2.53ghz Core 2 Duo
  • Gigabyte G31-based motherboard with on-board video (more on this later)
  • 4GB of DDR2
  • 60GB Intel SSD (boot drive)
  • (2x) 500GB WD ‘Green’ HD
  • 1TB WD ‘Green’ HD
  • External 1TB WD HD
  • External 750GB Seagate HD

The Install

Let me back up a little bit. On the WHS box I had all of the WD drives plugged in at all times in a sort of bizarro RAID that WHS calles Drive Extender. I had all files duplicated across at least 2 drives. The Seagate drive was plugged in from time to time to do a backup of the WHS OS, and otherwise stayed powered off.

My first instinct was to slim down some of the stuff I didn’t need (my video collection stretches back to when I was in college, before you had what the kids call ‘the YouTube’, so I still had all sorts of old SNL clips, Family Guy clilps, etc. - nothing I need anymore) and fit everything on the 750GB drive. I started to copy over my three main shares (Photos, Music, & Videos) one share at a time, and about halfway through the Music share (about 300GB total), the file copy started erroring out. I switched to using Teracopy, and got the same problem. I kept at it for a little while, thinking I just had a few bad files, but after repeated errors, I realized it was the drive itself.

So I decided to play it a little risky - I disabled redundancy on my files and used the 1TB drive as the method for getting all of my files on to the Hackintosh server. Thankfully the files all copied over with no issues, and now that I had my files copied over, it was time to build my Hackintosh.

I started by downloading Mountain Lion from the Mac App store. Next I grabbed Unibeast from the Tonyx86 site (not yet optimized for 10.8, but I took a chance), plugged in a 16GB USB drive, and Unibeast took care of the rest. Now that I had a USB install drive, I disconnected all the existing drives, internal and external, and I installed the new Intel 60GB SSD.

I booted to the USB drive and started up the installer, and….I saw black.

So I restarted, and tried again….more black.

So this next time I turned on verbose mode, and apparently I’m just impatient - I just needed to let it do it’s thing. Once I got into the actual 10.8 installer, everything installed pretty smoothly.

Configuration

At this point I’ve got my 10.8 Hackintosh alive, but somethings don’t quite work yet. Nothing Apple ID related seems to work and the graphics are choppy and glitchy (it clearly doesn’t like my on-board video). But still, not too bad.

At this point, the idea is to run MultiBeast, which installs a bunch of fixes for Hackintoshes. It’s more designed for newer hardware, but I decided to just run it with the most basic options and see what happens. One reboot later and I didn’t have internet. A little bit of research and I realize I needed specific network drivers - thankfully Gigabyte had detailed instructions on my motherboard online still, so after a driver install and a reboot, I had my internet back. But still, no Apple ID services (including the App Store). A quick search on the Tonyx86 forums led me to try ‘deleting’ my Ethernet interface (eth0), rebooting, and then re-adding it. Bizarrely, this worked.

So I’ve got everything but graphics acceleration working, so I figured it was time to add my old drives in. I had to decide how to format them, and I took a chance on exFAT formatting. It works on both Mac and PC, and I wanted to hedge my bets - just in case. So I format the drives with exFAT and start copying over files. So far, so good.

Next I started creating shares for my pictures, music, and videos. I decided to use Server.app and had both AFP and SMB running on each share, making sure to give explicit permissions to both my login and my wife’s.

I first tested on a MacBook Air, and everything worked smoothly. Next I grabbed my regular Windows PC and tried accessing the shares…..and there was lots of sadness. My login didn’t work. The administrative login didn’t work. Mapping drives via IP didn’t work. There was, oddly enough, one exception - I had no problem viewing a share of the server’s boot drive.

I did all sorts of research to try to fix this issue - was it an SMB problem in Mountain Lion? Was I creating permissions incorrectly? Sadly, I didn’t find any good answers. So I naturally did what any IT nerd would do, and I started running down the list of similarities vs. differences for the boot drives vs. the other drives, and tried to isolate any differences. I immediately came across one difference - my boot drive was formatted with HFS+, and all of the other drives were formatted with exFAT. Just to test it out, I wiped one of the 500GB drives, formatted it as HFS+, and created a test share.

It worked.

I have no idea why (my Google-fu failed me), and I couldn’t explain it, but I went with it. After double checking to make sure that all of my data was still on the external 1TB drive, I wiped all the internal drives (again), formatted as HFS+, and tried making some shares.

And yes, it worked.

I should note that I took advantage of this reformat to setup the two 500GB drives in a striped RAID array. The data being stored on the drives isn’t critical, it’s backed up with BackBlaze, and I wanted the extra speed just in case. Anyway, now that I had working shares, I copied all my files over, again.

My last step to get the server up and running was to move my iTunes Library over. This was, predictably, more complicated than I thought it would be. I’m using iTunes Match, which is great, but it has a limit of 25,000 files. I’ve got a heck of a lot more than that, so my active iTunes Library is only 90 gigs or so, something like 16,000 songs. These are the songs that I knew I wanted to be available anytime I had a cell connection.

So back to moving an iTunes Match Library - I would ideally just blow away the Library and recreate it, but I didn’t want to hand select which songs would make the cut for iCloud again. So I copied the Library over to the Mac, launched it, and it worked, but it couldn’t find my files. I tried to open one of them, point it to the new location, and then a window popped up that asked if I wanted to use this new location to find the rest of my files.

Yes.

Aaaaaaaand it worked for about half of my files. No rhyme or reason. I was all set to re-create my iCloud Library from scratch when I remembered it’s just a big .xml file. I opened it up in Sublime Text 2, realized the location for each file is hard coded in the XML file, and after a gigantic find & replace, I was in business. One last thing to note - I’m taking advantage of Hazel (awesome piece of software) to automate my iTunes experience any more. I’ve got folders it looks for in Dropbox and on the server itself and it unzips any .zip files it finds, imports into the default iTunes Library, and then iTunes takes over and uploads it to Match. As far as I’m concerned, on my main computers, I don’t use iTunes anymore now. I just put files in folders and the server handles the rest. This is definitely progress.

Next Steps

Did I say last step? I meant the last step before I was comfortable with it running 24/7. I’ve still got a few more things to resolve. First up is to get automatic backups running on my main PC and my wife’s laptop, using the Hackintosh server as storage. I’m thinking of taking an image based backup now and then just doing file based backups (hopefully incremental) from here on out, but I have to see what’s really available.

I’ve also got two pieces of hardware I’d like to buy for the serve - a cheap SATA card, and a cheap video card.

As noted before, my Hackintosh server currently doesn’t have any graphic acceleration in the UI. That doesn’t bother me all that much, but if I can solve this problem for less than $50, I’d feel better about the situation.

Finally, I’ve got an extra SATA drive that I’d like to use a cloned boot drive (just in case), and my server still has a few more places I could stuff drives into, but I’m out of SATA ports. I’m going to try to find a relatively cheap PCI Express x1 card that would give me at least 2 SATA ports and works pretty smoothly in OS X. Again, if I can solve this problem for less than $50, I’m in good shape.

Final Thoughts

Overall I’m really happy with my new 10.8 Hackintosh Server. It’s a little risky to run my home server on an initial release of a new OS, but It’s been relatively stable so far (yes, I just knocked on the wood coffee table in my apt) and Server.app made the process of creating shares incredibly simple. Having iTunes running 24x7 is great, and the difference between having iTunes run on my main PC and talk to the files over a network connection vs. running iTunes on the Mac itself, with local drives being used for storage is incredible. It makes no sense that iTunes runs better on a Core 2 Duo than on my i5-based PC (that also has an SSD boot drive), but I’m going to chalk that up to the differences in iTunes for Windows and Mac.

Long story short - not only was the project successful, but I now know WAY more about how Mac OS works, and that was sort of the point of the project in and of itself. I’m hoping to get a few extra years out of this hardware (knocking on wood again), and then I imagine I’ll move to an actual Mac Mini. Unless I get the urge to build another Hackintosh.