Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

One way to play iTunes music over the internet Internet
This hint will allow you to stream your music over the Internet using any version of iTunes. It relies on Macfuse and Macfusion to mount an ssh connection as a local file server. Please back up all music before you try this, as if you delete all your music by mistake, it's not my fault! First, on the Mac that's going to send the music (the "server"):
  1. Quit iTunes
  2. Copy your iTunes Music folder to another partition or an external drive. My other partition is called Store.
  3. Open iTunes, and go to Preferences » Advanced. Change the following settings:
    • Change iTunes Music folder location to Store:iTunes Music, with Store being your partition name.
    • Insure that Copy Files to iTunes Music Folder When Adding to Library is unchecked.
  4. Quit iTunes again.
  5. You may want to back up to somewhere else before doing this step. Delete the following files from your Music:iTunes folder: iTunes Library and iTunes Music Library.xml.
  6. I recommend that you move the iTunes Music folder that is also in this directory to your Documents folder for backup. You can delete it at the very end if everything goes OK.
  7. Now open iTunes again. We are going to regenerate your iTunes Library. You will note that iTunes creates the two files from above again on launch. This is what you want.
  8. In iTunes go to File » Add to Library. Select the other partition and the iTunes Music folder that you copied there in step two. The files will be added to the Library, but will not be copied to your boot partition as you unchecked that box earlier.
  9. Once this is complete, you can quit iTunes just to clear up your screen.
  10. Open System Preferences » Sharing, and turn on Remote Login. You will need this later.
  11. Copy the following files by any means to your client machine -- note that these are the new ones you have created, not the older ones you moved: iTunes Library and iTunes Music Library.xml.
Read on for the setup for the listening ("client") Mac.

Here's what you need to do on the machine that will be playing the music:
  1. Install Macfuse and Macfusion. It's beta software, but they're very good quality betas. You may need to reboot. Do so if prompted.
  2. Once all rebooted and installed, insure that iTunes isn't running.
  3. Back up everything in your Music » iTunes folder on this Mac; I recommend to your Documents folder. So now your Music » iTunes folder should be empty. Do not launch iTunes until told to do so.
  4. Open MacFusion. You will see it launch to a menu item on the top of the screen.
  5. Select it, and pick Quick Mount SSH.
  6. Enter a Name -- it needs to be the same name as the name of the volume on the server; Store in my case. Enter information on your server (DNS or IP; see below how you can get a DNS name if you don't have a direct web connection). For the Server Path, enter, for instance, /Volumes/Store in my case. Enter your short username for the server as Username. Click OK. You will need to enter your password to mount the server. You can also add this to your keychain at this stage.
  7. Now you should see a network partition mounted on the desktop. If you don't, then open Terminal and type open /Volumes/Store, with Store being the name of your partition. If you see that you have access to your remote partition on the server, you can continue. Otherwise, go back to MacFusion and try again.
  8. Now move the files you copied from the server to your Music » iTunes folder.
  9. Open iTunes.
If all went to plan, you will be able to play all the files from your server on your client's iTunes. You will need to mount the remote drive after each reboot to play the music.

Advanced Notes:
  • You can also make a second partition out of some of the free space that you have on your internal drive in Leopard using Disk Utility. Don't leave too little space on your OS/Boot partition as it needs disk space for swapping. I would leave at least 20GB free on the boot partition. Again here you do this at your own risk. You should back up before doing this, as it could all go wrong, but it has never happened to me.
  • It is presumed that you have a direct connection to the web with the machine that contains your iTunes Music. Of course, if you don't, then you can use port forwarding to expose your SSH port to the web. Even if you have a dynamic IP, you can use DynDNS, which is free, to give your Mac a static DNS name.
  • You can have iTunes open and running on both client and server, playing at the same time without any problems. If you add stuff on the server, you will need update the two client files that you copied from the server again.
  • There is software that helps you manage multiple Libraries for iTunes. You could use one of those, or multiple users on the client, so that you don't have to mess with iTunes on your Client.
[robg adds: I haven't tested this one -- and please, heed the backup warnings. There's lots of moving and deleting going on here, and losing your music (especially purchased songs) would really ruin your day.]
    •    
  • Currently 1.67 / 5
  You rated: 1 / 5 (9 votes cast)
 
[17,726 views]  

One way to play iTunes music over the internet | 15 comments | Create New Account
Click here to return to the 'One way to play iTunes music over the internet' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
One way to play iTunes music over the internet
Authored by: carldr on Jan 09, '08 08:25:45AM

A much better way of copying your music to a new location is by doing :

1. Open iTunes, and go to Preferences » Advanced.
1.1 Change the following settings:
Change iTunes Music folder location to Store:iTunes Music, with Store being your partition name.
1.2 Ensure that Copy Files to iTunes Music Folder When Adding to Library is unchecked.
2. Go to Advanced >> Consolidate Library, and confirm the action in the pop-up window.
3. Wait a while :)

All your music will be copied to the new location, and your iTunes library will be updated at the same time. Your music isn't deleted from the source location.

I much prefer this method, as I've followed the steps details above and I've ended up with iTunes not being able to locate any of my music even though it's in the place matching the iTunes Music folder location. I would still take a backup of your actual iTunes library files though, just in case.



[ Reply to This | # ]
One way to play iTunes music over the internet
Authored by: nofutureuk on Jan 09, '08 09:04:37AM

The above hint has several problems:
- requires real good upload bandwidth (with low latency from the server)
- assumes that accessing files with iTunes on a network mount is efficient
- you have to fiddle with iTunes libraries
- is sort of complicated (many steps needed)

Anyhow, I would suggest using the iTunes built-in library sharing, if possible. This means that the server must be either Mac OS X or Windows. I think it is also possible to use some sort of daap server on Linux though.

Access to the iTunes shared library can be accomplished over the internet with OpenVPN.

Advantages:
- once you have openvpn running, you basically can do anything you can do at home/LAN (including AFP)
- no fiddling with your iTunes library
- good usage of bandwidth through optimized streaming with daap (with 756kBps upstream, I get hickups with the solution from the above hint, whereas it works super-fluent with iTunes sharing)
- easy use (see the TunnelBlick OpenVPN client)

Disadvantage:
- you have to set up OpenVPN (probably on your router)



[ Reply to This | # ]
One way to play iTunes music over the internet
Authored by: nofutureuk on Jan 09, '08 09:08:46AM

I forgot to mention a killer problem:

most people use NAT routers, so their machines won't be reachable from the internet in the first place. Instead of going for port forwarding or tunneling systems for single machines, why not setup a tunnel to your LAN at home/wherever.

That's actually the biggest reason why I chose OpenVPN: It does not introduce new problems (except of course setting it up).



[ Reply to This | # ]
One way to play iTunes music over the internet
Authored by: romahony on Jan 09, '08 01:33:07PM

Have you ever set up iTunes sharing over VPN ?

I wasn't aware that it worked. If you have done this rather than just a theory then fine but please provide some proof of this solution as iTunes sharing works only on the same subnet.



[ Reply to This | # ]
One way to play iTunes music over the internet
Authored by: nofutureuk on Jan 10, '08 03:01:33AM

yes it does work, I use it daily.

The point is that with OpenVPN you can be in the same subnet... although that is a matter of configuration of the vpn...

The idea is using a VPN to "teleport" your computer to the remote subnet, which really is one of the basic ideas of VPNs in the first place.



[ Reply to This | # ]
One way to play iTunes music over the internet
Authored by: cobbe on Jan 12, '08 08:07:39PM

I'm trying to use OpenVPN/Tunnelblick to get this working, but I'm still missing something. I've successfully installed and configured OpenVPN and Tunnelblick, and I'm able to ping and even SSH across the VPN connection, so I know that's working. But the VPN client can't see the iTunes library on the VPN server.

I've enabled iTunes sharing on the server and asked the client to look for shared libraries, but that still doesn't help. I know that sharing is working over physical (i.e., non-VPN) networks, because another machine on the server's physical subnet can see the server's library, and the client can see other shared libraries on its (physical) subnet.

You mentioned using OpenVPN/Tunnelblick to "teleport" the client machine to the server's subnet. Does that imply another configuration step I have to perform?



[ Reply to This | # ]
One way to play iTunes music over the internet
Authored by: nofutureuk on Jan 14, '08 06:18:22AM
The most important thing to note is to use a bridged tunnel, e.g. use a "tap" device. This makes sure that the ethernet segment is essentially enlarged by the connected tunnel endpoints. It also enables DHCP for the client if needed.

The other important thing to note is that the nodes must all be in a private LAN address space , e.g.
10.0.0.0 - 10.255.255.255 (10/8 prefix)
172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
192.168.0.0 - 192.168.255.255 (192.168/16 prefix)

See RFC 1918: http://www.faqs.org/rfcs/rfc1918.html

Of course, the usual firewall settings apply as well...

[ Reply to This | # ]
One way to play iTunes music over the internet
Authored by: cobbe on Jan 14, '08 10:20:50AM

Thanks for your reply!

My problem was the TAP/TUN setting. I'd been using TUN, which is openvpn's default, and switching it to TAP on both sides worked fine. I can now see the server's iTunes library on the client machine.

Now all that remains is to see if the sound quality is workable across the VPN, but that'll have to wait until I'm actually in the office, where the client machine is located. (I'm working from home today due to snow and playing with the client-side VPN config over a VNC connection.)

Thanks again!



[ Reply to This | # ]
One way to play iTunes music over the internet
Authored by: cobbe on Jan 14, '08 10:23:45AM

I meant to include this in my other reply. For the benefit of others reading this thread, the VPN's IP addresses have to be in the private ranges; the actual physical IP addresses of the machines in question don't appear to matter.



[ Reply to This | # ]
One way to play iTunes music over the internet
Authored by: romahony on Jan 09, '08 01:38:26PM

also how good does your solution work if the itunes library is huge so that the library file is over 100 MB ? Then your solution will not work well.



[ Reply to This | # ]
One way to play iTunes music over the internet
Authored by: nofutureuk on Jan 10, '08 03:05:46AM

the libray I use has 70GB+ and the only drawback is that when I initially click on the shared library icon (on my local computer that has the VPN client), it has to fetch the library information which takes about 30-60 seconds. But since I do that only once a day, I can well live with it.



[ Reply to This | # ]
One way to play iTunes music over the internet
Authored by: nofutureuk on Jan 10, '08 03:09:34AM

my libray file has 26 MB.

Why do you assume the built-in sharing will be less efficient than copying the whole library file around?
I don't really know how the daap protocol works, but what I observe is that the transferred data with the initial connect is definitely less than the filesize of the library file.



[ Reply to This | # ]
One way to play iTunes music over the internet
Authored by: Alrescha on Jan 10, '08 08:17:16AM

I think this has been posted in another hint already, but if both machines are Macs you can just tunnel AFP (port 548) over the SSH connection and avoid the whole MacFuse/MacFusion fiddlyness. Furthermore, if you have .Mac and a compatible router, you can use Back To My Mac and share the music over an IPSec connection.

A.



[ Reply to This | # ]
One way to play iTunes music over the internet
Authored by: jelockwood on Jan 10, '08 08:20:42AM

In this form, this hint requires enough outgoing bandwidth to cope with bitrate of your music files. If your iTunes library contains just MP3 tracks then that might only be between 128 and 256Kbps, or for AAC also between 128 and 256Kbps. However if you use AIFF or WAV it might need to be as high as 1.2Mbps. My own library is all in Apple Lossless and averages about 700Kbps.

Since the most common outgoing speed of home DSL links is a mere 256Kbps even MP3/AAC tracks may on occasion struggle (remember the link is often shared with other customers and possibly other applications on your own network, let alone overheads in networking protocols themselves).

The approach I have done (just to prove it can be done, in the real world this is what an iPod is for after all), was to install the free SlimServer software on my Mac. The SlimServer software can share the iTunes library, but more importantly it can be configured to transcode the music to a specific format and bitrate in real time. I therefore set it up to transcode to 128Kbps MP3 (I found even 192Kbps sometimes struggled with my mere 256Kbps outbound connection). I then use the free SoftSqueeze Java client to access the SlimServer and browse and play any track I want.



[ Reply to This | # ]
Listen to Your Home iTunes Collection from Work
Authored by: shacker on Jan 25, '13 08:20:22AM

If you want to go the whole distance, here's a complete guide on setting up Nicecast and Screen Sharing so you have full control of your home machine from work, and can listen to high-quality audio streamed from iTunes at the same time - the best way around Apple's Home Sharing limitations that I've found:

http://birdhouse.org/blog/2013/01/25/listen-to-your-home-itunes-collection-from-work/



[ Reply to This | # ]