Centrally Managed iTunes Library on Windows Home Server

picture of some vinyl record singles I decided to move my iTunes Library to a shared folder on my Windows Home Server. The HP MediaSmart Server does come with the ability to stream songs to any computer running iTunes on your home network. But this only provides streaming ability, which I can already do from my iMac. I wanted to be able to manage the library from any Mac, not run multiple iTunes simultaneously. This does not provide the ability run multiple copies of iTunes at the same time, rather it allows the library to be stored on a server and managed from multiple computers.

This article at Mac OS X Hints, provides information on how to share iTunes between Mac and Windows. While the procedure basically worked I had some problems, possibly due to changes in iTunes since the article was written, possibly due to something unique in my setup or requirements.

I had two problems:

  1. iTunes would not let me select the library on the share from my iMac. When I option->clicked to open iTunes and browsed to the WHS it wouldn’t list anything (literally – no shares, no files). I ended up creating an alias (sym link) to the iTunes directory on my WHS music share. I could then browse to the alias and select the library. To add to the frustration this worked fine from my other Macs but still fails to work on my iMac, even moments after shutting down iTunes.
  2. Switching between the Windows and Mac versions of iTunes caused the library to rebuild each time. I didn’t like the delay. Besides, all my Windows machines are virtual machines running on a Mac so I don’t need Windows iTunes. This appears to be due to the way iTunes addresses the library and it updates the path to the files. But the procedure outlined in the Mac OS X Hints article does work and there may be a way to specify the location that will be both Mac and Windows happy.

You may want to turn off DS_Store files on network drives, if you haven’t already. The process for setting up my specific WHS configuration is documented below.

Setting Up the Share

I decided to create a folder called iTunes under the common Music share that was there upon delivery. Since my iTunes library was on my iMac I needed to set that up to connect to the share. I browsed to the share in finder to mount it and told OS X to save by id/password in my keychain. You can also mount it by selecting Go -> Connect to Server in the Finder menu. Type in your WHS name in the format smb://servername, where servername is your WHS. You’ll be prompted to pick the share and enter a ID/Password (if it’s not already saved in your keychain).

I want this share mounted all the time so I’ll add it to my start up items. To do this go into the Accounts panel in System Preferences. Select the ID and then the Login Items tab. Click the plus sign to add an item then browse to the new iTunes folder on the Windows Home Server. Click the Add button and it will appear in the startup list. To work seamlessly the id/password should have been added to the keychain when you manually connected.

Moving the iTunes Library

I moved the iTunes library from my iMac to the Windows Home Server by following the standard procedure for moving an iTunes library on a Mac with some minor modifications. Be sure to select a sub-directory of iTunes for the files, I created iTunes Music to match the standard. After finishing the standard move process (the bulleted items in the Mac OS X Hints article) I copied the iTunes Library file from my local iTunes folder to the iTunes folder on the share. I did not add the extension so it’s still Mac only.

I could not do the next step on my iMac until I created an alias. Browse (in Finder) to the iTunes directory in the WHS music share (not the “iTunes Music” folder with the song files, but the main iTunes directory.) Right-click (or control-click for one-button mice) the iTunes directory and select Make Alias from the menu. Then move the alias that was created to your local hard drive. I put mine in my home directory. I did not need to do this on my Mac Mini or MacBook.

Start iTunes by holding the option key when you click the icon (aka option->click it) browse to the alias you just created, then select the iTunes Library file and open it.

The album art will be missing so now’s a good time to copy it. Copy the contents of the Album Artwork folder (located in the iTunes Folder) from your local PC to the iTunes directory on the network share. I did this with iTunes shut down (not sure if it matters but to be safe) and made sure the network directories were empty of files.

At this point I just option->click iTunes on each of my Macs the first time I start iTunes and select the shared iTunes Library file.

I still haven’t deleted my old local iTunes library although I did rename the iTunes folder.

Additional Information

I haven’t purchased or used any iPod games although the one demo game I had (Vortex) seemed to move to the server share just fine. This may have occurred when I first synced my iPod as I was told some purchased items were missing and I let them be restored from the iPod. I didn’t notice the directory earlier but since I didn’t have any games I didn’t think to specifically check. You may also need to manually copy the iPod games directory and library file to the share, or make sure they get restored from your iPod.

I did try using iTunes for Windows and Mac to access the same library. This did work but every time I switched the OS the Library was rebuilt which was time consuming. Since I have no real need for iTunes on Windows I decided to drop it.

Since doing this I’ve had problems keeping my sync connection to Apple TV. Apple TV still only syncs with my iMac and not with any Mac that has the library open. The iTunes name displayed for sharing is still unique on each computer. But, I’ve had to set up syncing for my Apple TV to iTunes a couple of times since setting up the shared library. I’m unable to reproduce the problem on demand by going to the different copies of iTunes and starting them and then checking my iMac iTunes. But eventually it just disappears. I’ve never had a iTunes sync problem before but others have so this may be unrelated to the shared iTunes library. Or, it could be related to the DRM that limits Apple TV to one iTunes library for syncing. The good news is all I’ve had to do is re-authorize it, it doesn’t clear the hard drive and cause everything to resync again or force me to reconfigure what I want synced.

My iTunes Library file consists of about 8,100 titles and is about 19MB. When shutting down iTunes over a wireless connection there is a short but noticeable delay while it saves the library. Over my 802.11n network it takes less than 10 seconds and over 802.11g it takes about 20 seconds to exit iTunes. Not a problem for me, but noticeable.

Backup Considerations

Windows Home Server has the ability to duplicate shares which means it makes sure there’s a copy of the file on two different physical drives. Not exactly mirroring, but similar in concept. With the iTunes Library on my Mac it was being backed up in Time Machine and on my drive clone, two different pieces of hardware. On WHS it’s on two physical drives but not truly backed up. If a WHS drive fails I’m OK, but if WHS itself or the server hardware fails the files are trapped. Also, if something gets deleted from WHS accidentally it gets deleted from the duplicate drive too. The same with corruption.

I’ll probably set up something with ChronoSync to copy the library down to a local drive either as a current backup or to be picked up by Time Machine. The benefit of Time Machine is I’m not locked in to restoring only the latest files. If I missed some deletion corruption I can go back. Unfortunately my iTunes library is just to large to back up over the Internet to something like Amazon S3. It would max out my upload bandwidth for weeks.

3 thoughts on “Centrally Managed iTunes Library on Windows Home Server”

  1. Neat solution Ray! FYI – and I’m not sure this is directly applicable to your scenario but might be of interest anyway! – you could turn it the other way around and run full iTunes on your HP MediaSmart server with Home Sharingr. I happened across an app called iHomeServer that allows you to auto-start iTunes on servers, by running it as a Windows service.

    You can then turn Home Sharing on the WHS server and access it as a shared iTunes server from your Mac.

Comments are closed.