Yesterday while writing my thesis in the library, I was listening to some other person’s music she had shared through iTunes. It’s a nice feature they’ve got there, so it got me tinking “could I make my Linux server at home share my whole music collection like an iTunes share?”.
After some quick Googling I found out that it’s actually possible and the software is already out there. Just to compile and install. However, the instructions I found was either not verbose enough or not applicable on my setup.
On-the-fly-comment: Now I suddenly found out that there’s a project called firefly that replaces the daapd that I’ve been using here. This information makes this post almost completely useless, but I’ll go on anyway, skipping the part about compiling and hacking daapd.
So this was the scenario: I’ve got all my mp3s on my Linux server, which I usually mount to my desktop machine (also Linux). I can’t bother mounting the share on my MacBook (since I’d have to import the whole library into iTunes’ database and I don’t want that), but instead it would be nice to have the library accessible as an iTunes share. This is how I got it working.
Disclaimer: If this fucks up your computer, it’s your problem.
In my setup (debian Sarge) I need two components to get it running: firefly (formerly mt-daapd) and mDNSResponder from Apple’s Rendezvous suite (nowadays Bonjour). The latter makes your Linux computer show up as a shared library in iTunes, and the former actually streams the music.
- Download the source for the Rendezvous suite from Apples site. You’ll need to register.
- Unpack it
tar -xzvf Rendezvous.tar.gz
- Enter the subdirectory mDNSPosix
cd mDNSResponder*/mDNSPosix
- Compile with the appropriate flag
make os=linux
Normally, this is where you say ‘make install’ or ‘checkinstall’ or something like that. If you do that, you’ll install the mdnsd daemon, which is totally unnecessary for our purpose, so we’ll just skip that. Instead, take a look in the build directory and its subdirectories. You should find a binary called mDNSResponderPosix. This is what we need.
- Copy the binary to some suitable bin directory (and modify your path if needed)
cp mDNSResponderPosix /usr/local/bin
- Create a config file /etc/mdnsresponder.conf with the following contents (modifying the first line to something appropriate for your particular share)
Marvin's JukeBox _daap._tcp. none 3689
- Download my init.d script and save it as /etc/init.d/mdnsresponder
That was the first part. Now you should be able so say (as root) ‘/etc/init.d/mdnsresponder start’ to get your machine visible in iTunes. There are still no songs to browse though.
Next, download firefly. If you’re lazy like me, then look for the most recent .deb package in the version tree and save that on your Linux machine.
- Install the .deb you just downloaded (as root)
dpkg -i mt-daapd_*.deb
- Edit the config file to suit your needs (it’s well commented)
emacs /etc/mt-daapd.conf
- Then just fire up the daemon with the supplied init.d script (as root)
/etc/init.d/mt-daapd start
Now, if you’re lucky and have edited the config file right, mt-daapd should start the initial scanning of your mp3 library. After that, all your mp3s should be browsable and playable through the new share in iTunes.
At least in with the version of mt-daapd I’m using (0.2.4) I get two identical shares in iTunes. I haven’t figured out why and frankly I don’t care as long as I can play my music.





0 Responses to “Sharing music from Linux to iTunes”
Leave a Reply