Share iTunes library with OS X and Windows via a server

Apr 26, '07 07:30:00AM

Contributed by: Crazor

After some trial-and-error research, I finally managed to move my iTunes library from my MacBook to a Linux file server, and to also use it from Windows machines. I wanted to be able to manage my library from all the computers on my network, so the iTunes sharing option was not enough. But I am the only user of the library: there will not be more than one instance of iTunes using (modifying) the library at once, otherwise this hint will certainly not work (see note at the bottom).

My file server (running Gentoo Linux) runs Samba for Windows sharing and netatalk for AFP. On each computer, I mount my Linux home directory. In it is a folder named iTunes, with the usual library structure. Now the steps to follow for achieving my setup: On your network share, create a folder called iTunes. To begin moving your library, make sure you have mounted your share on your Mac. Then follow these steps:

Next, quit iTunes (completely; closing its window is not enough). Open Finder, go to Music » iTunes inside your home directory. Copy iTunes Library to your network share, inside the iTunes directory. Rename that file to iTunes Library.itl -- this is neccessary for Windows iTunes to recognize your library.

Next, still on your Mac, option-click iTunes. It will ask you which library to use. Choose iTunes » iTunes Library.itl on your network share. iTunes then rebuilds the iTunes Library.itl.xml file, and finally starts as normal. To check that it opens the music from your share, get info on a song, and make sure that the location is correct. Now quit iTunes.

On your other Macs, mount the share, option-click iTunes, and choose the correct library.

On your Windows machines, mount the share and shift-click iTunes to get to the library chooser. Then simply choose the library on your share. iTunes will then re-create iTunes Library.xml. It is a bit weird to find an iTunes Library.itl.xml and an iTunes Library.xml on your share, but everything works fine. When you change something on one of your Windows machines, your Mac's iTunes will update the iTunes Library.itl.xml file, and vice versa.

Note: This hint is not for multiple users. While modifying your library, make sure that only one instance of iTunes is running, otherwise changes will be lost if one of the other instances is quit after yours. Probably you can write protect the library on your server for other users to prevent them damaging your library, but I have not tested this.

Comments (13)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20070424081346722