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

Use iTunes 9's Home Sharing over the Internet Apps
I wanted to be able to use the dead-simple iTunes Home Sharing with a friend over the internet. So I downloaded HamachiX (I have 10.6.1, and for some reason the newest update didn't work, but .9 (1B1) does work), and then set both Home Sharing setups to the same user.

Step by step:
  1. Download HamachiX, and have your friend do the same.
  2. Run HamachiX and let it do all the fun things it needs to do. Then click the Plus button and make up a network name and password. Optionally open the Preferences and set a nickname for simplicity's sake.
  3. Choose Create Network [and have your friend launch HamachiX and choose Join Network].
  4. Give HamachiX a minute, and hit Refresh until you see your friend is connected.
  5. Open iTunes and set up Home Sharing with the same account on both machines. If you had previously set up Home Sharing, click Advanced » Turn Off Home Sharing, then turn it back on to switch usernames.
If everything went right, you should see your friend's iTunes library show up, and you can download to your heart's content as though they were sitting in the same room as you.

The initial period where iTunes finds the other machine took a while. At first only one library showed up, and then eventually both did. We just kept restarting iTunes and Hamachix until things worked. We also turned on file sharing and were able to access each other's computers, but I'm not sure if that is necessary for the iTunes Home Sharing.

[robg adds: This hint is usable for a completely legitimate reason: You can use it to share your home iTunes library with your own laptop while traveling. As for sharing your library with a friend, the legality of that depends on the files you're sharing, and the laws of your country. Mac OS X Hints isn't responsible for how you use this hint, so proceed at your own risk. Also note that this means you'll need to share your iTunes account info, which (to me, anyway) means you're unlikely to use this to share with just anyone.]
    •    
  • Currently 2.18 / 5
  You rated: 2 / 5 (11 votes cast)
 
[34,983 views]  

Use iTunes 9's Home Sharing over the Internet | 14 comments | Create New Account
Click here to return to the 'Use iTunes 9's Home Sharing over the Internet' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Use iTunes 9's Home Sharing over the Internet
Authored by: antifuchs on Oct 07, '09 08:46:07AM
I am doing something very similar with my laptop and my iMac at home, using Viscosity and an openvpn server. See http://mublag.boinkor.net/post/28132867/Getting-Home-Sharing-to-work-OpenVPN for setup instructions. When you're done, you can see and use all Bonjour services of the machines in your VPN, including iTunes home sharing.

This works better for me than Back to My Mac, actually. OpenVPN (and by extension, Viscosity) can tunnel through all sorts of nasty firewall setups, so now I can use the things in my home from everywhere.

[ Reply to This | # ]
Use iTunes 9's Home Sharing over the Internet
Authored by: macslut on Oct 07, '09 10:25:03AM

Any chance on getting some help with how to set up an openvpn server? This sounds pretty cool, but in the meantime, I'm just using MyTunesRSS which allows a web based interface to iTunes along with downloading songs. One possible advantage (aside from being really easy to set up), is that it doesn't require being logged into the iTunes account. You can however set up users with passwords within the app if you'd like.



[ Reply to This | # ]
Use iTunes 9's Home Sharing over the Internet
Authored by: dizziness on Oct 07, '09 10:27:04AM

I do something similar as well, using iVPN to control the integrated L2TP server in Mac OSX, the integrated L2TP client and Yazsoft's ShareTool. It not as economical as the OpenVPN/Viscosity option. Plus ShareTool currently only shares Bonjour in one direction, meaning only shared library and not Home Sharing. The developer is working on it.

If someone has a simple OpenVPN server setup, I'd make the switch.



[ Reply to This | # ]
Use iTunes 9's Home Sharing over the Internet
Authored by: antifuchs on Oct 07, '09 01:40:27PM
The server setup is pretty easy; hardest part is generating the certificates (and easy-ca takes good care of that for me). If you're interested, check the configuration file that I use: http://boinkor.net/openvpn/vpn.boinkor.net.conf - you just supply the keys and the server to run the thing on.

Come to think of it, a server machine would be the most expensive thing if you don't have one running already; I think you can set up your iTunes library host computer to be the openvpn tunnel endpoint; this way you'd just have to figure out any port forwarding measures for the openvpn protocol port (I use 443/tcp, as that's the one most firewalls will let through unchallenged) if that computer is in a NAT network setup.

[ Reply to This | # ]
Use iTunes 9's Home Sharing over the Internet
Authored by: quangdiggity on Oct 07, '09 07:44:05PM
Inspired by this hint and antifuchs' comments, I managed to get iTunes Home Sharing working via OpenVPN and tap. My solution was cobbled together from several google search results.

Here is a rough sketch of how I did it.

Mac server

  1. Install OpenVPN using MacPorts.
  2. Setup certificates by following the HOWTO instructions. (This is the hardest step.)
  3. Configure the OpenVPN server (my server.conf is below)
  4. Install the taptun kernel extension
  5. Poke a hole through your firewall/router for the OpenVPN port (default UDP 1194).
  6. Add OpenVPN to LaunchDaemons (code below).
  7. You may need a restart to launch OpenVPN.
  8. Warning: If you install viscosity on the server, it may want to update the taptun kext and disable their autoloading. Don't let it do this. You can get around by copying the relevant kexts from within the Viscosity.app bundle to /Library/Extensions/.
Mac client
  1. Install Viscosity
  2. Add a new connection in Viscosity, being sure to select "tap" for the device.
    • Select "tap" for the device.
    • Leave "Enable DHCP," "Enable DNS support," and "Send all traffic over VPN connection" unchecked.
    • Copy your certificates and key from the server and add them to Viscosity.
server.conf (place in /opt/local/etc/openvpn/ or wherever you decided to place the OpenVPN config files)
# You can use a different port and/or tcp instead of udp if you like
port 1194
proto udp
max-clients 10

dev tap

# Set 10.0.2.0 to something that does not conflict with the subnet your server is on.
# My home mac is on subnet 10.0.1.xxx so I chose 10.0.2.0
server 10.0.2.0 255.255.255.0

ca keys/ca.crt
cert keys/server.crt
key keys/server.key
dh keys/dh1024.pem

keepalive 10 120

comp-lzo

user nobody
group nobody

persist-key
persist-tun
openvpn2.plist (place in /Library/LaunchDaemons/ and set /opt/local/etc/openvpn below to wherever you placed the OpenVPN config files)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">

<dict>
        <key>Label</key>
        <string>org.openvpn2</string>
        <key>OnDemand</key>
        <false/>
        <key>Program</key>
        <string>/opt/local/sbin/openvpn2</string>

        <key>ProgramArguments</key>
        <array>
                <string>openvpn2</string>
                <string>--config</string>
                <string>server.conf</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
        <key>TimeOut</key>
        <integer>90</integer>
        <key>WorkingDirectory</key>
        <string>/opt/local/etc/openvpn</string>
</dict>


[ Reply to This | # ]
Use iTunes 9's Home Sharing over the Internet
Authored by: quangdiggity on Oct 07, '09 07:58:00PM
Use iTunes 9's Home Sharing over the Internet
Authored by: echamings on Oct 15, '09 05:55:36AM
Trying to follow the instructions here, setting up the keys was a major hassle, so much so I had to ditch that and run with a static key, which seams simpler for a 1-1 VPN solution. It was constantly telling me that I had to define KEY_DIR, no amount of defining the variable in vars or putting in the path would get it any further. No idea what was causing that.

I have a question about getting openvpn to run however. So I am at the stage where I have openvpn installed via macports, a static key, tap/tun installed, and an edited server.conf file. I am attempting to run openvpn2 in this manner: openvpn2 --cd /etc/openvpn --config /etc/openvpn/server.conf and I am presented with this:

Options warning: Bad backslash ('') usage in /etc/openvpn/server.conf:1: remember that backslashes are treated as shell-escapes and if you need to pass backslash characters as part of a Windows filename, you should use double backslashes such as "c:openvpnstatic.key" Use --help for more information.

Now, there are ZERO slashes in my config file here:
port 1194
proto udp
max-clients 10

dev tap

server 192.168.2.0 255.255.255.0

secret key.txt

keepalive 10 120

comp-lzo

user nobody
group nobody

persist-key
persist-tun

I can't get any further. Does anyone have any ideas?

[ Reply to This | # ]
Use iTunes 9's Home Sharing over the Internet
Authored by: Patrick_Berry on Oct 08, '09 01:39:55AM

I don't listen to my music over the internet, but I do have two machines I synchronise over my home network.

This is what I use, it relies on setting up ssh connections on both machines (if you want to go in both directions).

#!/bin/bash
NAME=`whoami`

/usr/bin/nice /usr/bin/rsync -av --delete /Users/$NAME/Music/iTunes Other_Machine.local:/Users/$NAME/Music



[ Reply to This | # ]
Use iTunes 9's Home Sharing over the Internet
Authored by: Soylent Yellow on Oct 15, '09 02:02:49PM

I have been using the rsync method for years, with two machines on separate locations over the Internet. Always worked great, but since iTunes 9 it became troublesome.

With iTunes 9 iTunes insists on determining ‘gapless playback' after syncing to the local machine for each and every track. Which in the case of nearly 8000 tracks takes quite a while. And while it is possible to stop this action bij clicking the (x) in the player window, it will always fire up again after some time.
And I have all tracks as NOT belonging to a gapless album, so it should not try to determine ‘gapless playback' in the first place!



[ Reply to This | # ]
Use iTunes 9's Home Sharing over the Internet
Authored by: L00K143 on Oct 09, '09 12:46:34AM

instead of using HamachiX can we use Remobo? and if so is the set up similar to the set up described above. Only reason i ask is because to install HamachiX i need to re-install Rosseta to run it.



[ Reply to This | # ]
Use iTunes 9's Home Sharing over the Internet
Authored by: chakrapani_007 on Oct 09, '09 12:08:36PM
Or you could just use simplify(www.simplifymedia.com) and access your itunes media from anywhere including your iphone

[ Reply to This | # ]
Use iTunes 9's Home Sharing over the Internet
Authored by: dizziness on Oct 12, '09 10:45:52AM

Following antifuchs suggestion, I managed to configure OpenVPN and my remote machine. This was nice, allowing access between the two. Even better though, was configuring the OpenVPN server on my WRT54GL router with Tomato firmware (with VPN mod). Now I have Home Sharing with all the machines on my home network, as well access to all the bonjour sharing available.



[ Reply to This | # ]
Use iTunes 9's Home Sharing over the Internet
Authored by: echamings on Oct 15, '09 03:09:44AM
Trying to follow the instructions here, setting up the keys was a major hassle, so much so I had to ditch that and run with a static key, which seams simpler for a 1-1 VPN solution. It was constantly telling me that I had to define KEY_DIR, no amount of defining the variable in vars or putting in the path would get it any further. No idea what was causing that. I have a question about getting openvpn to run however. So I am at the stage where I have openvpn installed via macports, a static key, tap/tun installed, and an edited server.conf file. I am attempting to run openvpn2 in this manner: openvpn2 --cd /etc/openvpn --config /etc/openvpn/server.conf and I am presented with this:
Options warning: Bad backslash ('') usage in /etc/openvpn/server.conf:1: remember that backslashes are treated as shell-escapes and if you need to pass backslash characters as part of a Windows filename, you should use double backslashes such as "c:\openvpn\static.key" Use --help for more information.
Now, there are ZERO slashes in my config file here:

port 1194
proto udp
max-clients 10

dev tap

server 192.168.2.0 255.255.255.0

secret key.txt

keepalive 10 120

comp-lzo

user nobody
group nobody

persist-key
persist-tun

I can't get any further. Does anyone have any ideas?

[ Reply to This | # ]

Use iTunes 9's Home Sharing over the Internet
Authored by: quangdiggity on Oct 26, '09 06:42:06AM
I forgot about that quirk with KEYS_DIR when creating keys for Open VPN according to the howto. The HOWTO says to execute

. ./vars
./clean-all
./build-ca


The problem is that your etc/openvpn directory probably is only writable by root, so you will try to run the above with sudo. However, the vars script sets the KEYS_DIR environment variable that clean-all and build-ca depend on, so you will need to make sure that it gets passed to them. This is what I did:

. ./vars
sudo -E ./clean-all
sudo -E ./build-ca


The -E option tells sudo to preserve your environment. Otherwise, clean-all and build-ca will be run in a fresh environment that does not have the KEYS_DIR variable set.

As for the backslash problem. I dont know. Have you tried running openvpn in the foreground with your current directory set to /etc/openvpn? i.e.

cd /etc/openvpn
openvpn2 --config server.conf


[ Reply to This | # ]