How to share an iTunes library between Mac & Windows?

Solution 1:

Getting both Mac & Windows able to read & write to the same location is just the beginning… [& frankly, the simplest method is probably to just format the shared drive as exFAT, which both Mac & Windows can read & write to natively.]

"Sharing the library" is something of a misnomer when it comes to manually keeping one iTunes Media folder synchronised between two different machines & two different iTunes instances.

You can do it, but each copy of iTunes will want to be "in charge" & they will not auto-synchronise at all. You would have to do that manually, every so often. It is not a quick task, but it can be done.

The first thing to do is establish which will be your Master & which your Slave.
It is going to be very counter-productive if you keep adding tunes & playlists to both iTunes, as you will then never be able to synchronise them. One has to be "in charge" the other merely a copy.

I'm going to assume we're using the Mac as Master, Windows as Slave.

Note: You are not going to be moving the default iTunes folder on either OS, only the Media folder location. You cannot make iTunes synchronise the main folder across what is essentially two machines.

Next, you need to establish what the full path to each is, from each OS.
As you've already discovered, the paths are absolute, not relative - so the next thing to do is take your Master iTunes Library.xml file & modify all the paths so that it will work on your Slave iTunes.

Assuming your stated paths are correct for each instance, then you need to take your Master xml file, duplicate it & search/replace the paths to match your Slave paths. Something like TextWrangler [freeware] is going to be good for this.

Open your Mac iTunes folder & copy the iTunes Library.xml file to the desktop. This is going to be our working copy of the Mac Master which we will modify & move to Windows. Leave the original where it is.

Open this duplicate Master iTunes Library.xml & scroll down until you find the first path instance, check it's correct - so, for instance your Mac path would be file:///Volumes/DATA/Music/ so in Search menu > Find… put file:///Volumes/DATA/Music/ in find & file://localhost/D:/Music/ in replace.
Replace all.

In your Slave iTunes folder, move the existing iTunes Library.xml & iTunes Library.itl files to the desktop, for safety.

Copy across your newly-modified .xml file to your Windows iTunes folder.
Don't launch iTunes yet.

Important Note
iTunes behaviour appears to have changed at approximately version 12.3
You can no longer break the .itl file & use that as your base to rebuild. iTunes now just claims it is damaged & will not use it.


post 12.3 method

Copy your newly-edited iTunes Library.xml to your Windows music/iTunes folder & your existing, unmodified iTunes Library.itl file directly from your Mac iTunes folder to your Windows folder, replacing the existing one, if it's still there.

Launch iTunes.
Open the prefs Ctrl ⌃ , go to the Advanced tab & first switch off 'keep organised' & 'copy to iTunes media folder'.
Then change the path to the correct one for your remote media folder location.
Click OK - if you are asked anything about 'should I organise/fix/etc' say no.

iTunes will do a quick 'Updating Library' & then you appear to be ready to go [I'm doing this live as I'm typing this answer…]

This method no longer appears to preserve the album artwork & instead iTunes will need to go fetch it all again, rather annoyingly.
As of iTunes 12.6 Album Artwork & play counts are once more preserved.

It runs like molasses whilst this is happening… but seems to be good once finished.


pre 12.3 method

This is the important bit that none of the 'moving my iTunes Library' guides tell you. They mostly tell you to Import this new XML from the Import menu - I've done it, it can take 12 hours & you lose some data.

Instead, we will make a new broken ITL file.
As I don't know how to do this on Windows, lets make one on the Mac & copy it over.

Open Terminal & enter this touch ~/Desktop/iTunes\ Library.itl That will create an empty ITL file on the desktop, broken enough for this.
Move this file to your Windows iTunes folder.

Launch iTunes. It will now notice something is 'wrong' & start rebuilding the ITL file, using your newly-modified XML file. The message is 'Importing ‘iTunes Music Library.xml’ This will take some time, but more like 15 minutes than 8 hours.

You may find some album artwork missing - it never seems to be a truly perfect solution, but your play counts, playlists etc should all survive intact.


You need to repeat this entire process every so often, to maintain sync between the two instances. You will always lose the play counts, etc from the Windows instance this way, but that's as close as you are going to get to fully synchronising iTunes.