vinnycoyne.com
Magical adventures in nerdery.

13 December 2010

Old Apple TV -> iTunes Media Server

UPDATE: See here for my latest setup

Since purchasing the new Apple TV, my old grey Apple TV has been collecting dust on a shelf in my office. With the new model retailing for $99 / €119, there's not much point in trying to sell it (especially with the lack of updates for it).

Currently, I'm streaming my media to the new ATV from iTunes on my MacBook Pro. All of the content is on a network drive, so the only reason for needing the MBP is for the iTunes library / Home Sharing features.

Seeing as the old ATV is a low-power, Intel-based Mac, I figured I'd have a go at installing Leopard on it and using it as a media server for the new ATV to stream from. That way, I can move all of the video-related tasks to a dedicated machine, which frees up my MBP for other tasks. It also means that the iTunes library will still be accessible when my MBP is offline or out of the house.

Installing Leopard onto your Apple TV

There are two ways of booting into Leopard on your old ATV:

  1. From an external hard drive connected via USB.
  1. From the ATV's internal hard drive.

Option 1 is the easiest method, and doesn't require any messing around with the actual ATV internals. I tried out this method first, and it worked, but in the end I decided to go with Option 2 because it freed up the USB port for other uses.

Both methods use essentially the same steps, although #2 is a little more involved.

In both cases, you'll need to download a customised Leopard disk image over on the Hackint0sh forums. I used the "Ready to use" 10.5.8 Disk Image torrent. Note: I'm not 100% sure of the legality of this (I own the Leopard DVD) - you can create your own custom image by searching around on hackint0sh if you'd prefer.

Opening the Apple TV (skip this if you're using an external USB drive)

What you'll need:torx screwdrivers, putty knife, IDE-USB connector, ethernet cable,iPartition, Carbon Copy Cloner / SuperDuper.

It was surprisingly easy to get into the old ATV. Simply, pry up the rubber base using a putty knife and peel it off. It's glued on and the rubber is a bit delicate, so take care that you don't tear it.

Next up, you'll need a set of torx screwdrivers in order to remove the base of the device. Remove all of the screws. Be careful when lifting the base of the device, as the hard drive is attached to the base and a ribbon cable connects it to the motherboard.

image

Unplug the ribbon cable from the motherboard to separate the base from the rest of the internals. I had to apply a bit of force to unstick the hard drive from the base.

Once you've removed the hard drive, plug it into your IDE-USB connector and plug it into your Mac.

Run iPartition and select the newly-mounted drive. You'll need to increase the space on the OSBoot partition so that Leopard can be installed on it. If you have any media on the old ATV, copy it from the drive now before you wipe that partition (it will be located on the Media partition). Delete the Media partition when you're ready and then expand the OSBoot partition to fill the empty space (I left about 1GB swap space free).

From the torrent you've downloaded, you should get a DMG file. In Carbon Copy Cloner or SuperDuper, clone the DMG to the OSBoot partition. CCC gave me some warnings after it completed, but it worked fine.

Right, you're ready to stick everything back together! Pop the hard drive back into the ATV and secure the base in place. The rubber base should also reattach without needing new adhesive.

Booting from an external USB drive (skip this if you're booting from the internal drive)

What you'll need: ethernet cable, Carbon Copy Cloner / SuperDuper.

While using an external drive means you don't have to open the ATV (and void your warranty in the process), it does have some drawbacks - I found that Leopard ran a lot slower over USB, I didn't have any spare USB ports available, and it was a waste of a hard drive.

All you need to do is plug a USB drive into your Mac, use CCC or SuperDuper to clone the torrented disk image to the drive, and then run a few terminal commands:

Get the disk identifier: * Open Disk Utility * Select the external disk from the left pane. Right click and select "Information" * Take note of the "Disk Identifier", eg "disk2" -> replace the diskX in the following steps with your disk identifier Change partition GUID: * Open Terminal * Use this command: gpt -r show /dev/diskX * Write down the numbers "start" and "size" of the line with index 2 * Unmount the disk: disktool -u diskX * Remove the entry with index 2 in the table: gpt remove -i 2 /dev/diskX * You get: gpt remove: /dev/diskX: 1 partition(s) removed * Unmount the remounted partitions: disktool -u diskX * Add the new GUID: gpt add -b START -s SIZE -i 2 -t "5265636F-7665-11AA-AA11-00306543ECAC" /dev/diskX -> replace the START and SIZE strings with your values. * Use this command again: gpt -r show /dev/diskX

Booting up and Logging in

Plug your ATV server into the network via Ethernet (WiFi won't work yet as Leopard won't know your network password) and power it up. The amber status light will keep blinking - it won't go white, so don't expect it to. If the ATV server doesn't boot after a few minutes, hold down the Menu and "-" keys on the old ATV's remote until it reboots.

If you're plugged in to a TV you should get a Leopard desktop (or you can connect via Screen Sharing if you're using it as a headless server - username & password are "appletv").

Setting up iTunes

To get iTunes on the ATV server talking to your new ATV, you'll need to upgrade to iTunes 10. Simply run Software Update and let it update everything (it's safe!). It should reboot - if it doesn't just pull the plug and power it up again. Run iTunes, make sure Home Sharing is turned on, and don't forget to Authorise it to play DRM-protected files for your account.

I copied across the actual library XML from my MBP to the ATV server - this saved me having to import the files from the NAS into iTunes all over again. On the Mac, this is located in /Users/<username>/Music/iTunes/. Note that this only copies the library, not the actual music or video - I didn't need to do this because my video is stored on a network drive.

Tidying Up

By default, the ATV server will be named "John Samuelsson's Apple TV" (after the guy who created the disk image you downloaded earlier) - you can change this by going in to System Preferences -> Sharing and changing the Computer Name.

VLC should be installed by default. I also installed Perian for additional codecs. You can also add Boxee, or Plex if you're so inclined.

I created a simple AppleScript which mounts the network drive on boot and I've also added iTunes to the login items, so that iTunes will autostart after a reboot (making it available for streaming on the new ATV).

Since my ATV server has a free USB port, I plugged in an Elgato Turbo.264 HD stick and installed the Elgato Turbo.264 software on it. Video conversion is noticeably slower however, which is to be expected (also, make sure that you install Perian, otherwise you'll end up with no audio!).

To improve performance, I dropped the screen resolution right down. Apparently, disabling Spotlight will also help, but I haven't tried that yet.

Last but not least, I stuck a blob of BluTack over the status LED as the constant blinking light was driving me mad…

image

← Back | 🔗 Permalink