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

Play iTunes from anywhere via SMB Network
OK, so this is probably a combination of all sorts of previous hints, but this is how I access, listen to, and even edit my iTunes music, located at home, from any place with an internet connection via SMB. This is an alternative to a recently published hint about using zerospan to access your iTunes music as shared music via Bonjour. I tried that hint, but didn't succeed because of firewall issues, I think.

Read on for the step-by-step...

I recently bought a LaCie Ethernet Disk Mini, and connected it to my router. I then copied my iTunes Music Folder (the actual audio files, in ~/Music -> iTunes -> iTunes Music) on my iMac G5 to the Ethernet disk, and then specified the name of the share as the new location for my music in iTunes' preferences (ie /Volumes/share/itunes music). iTunes just plays from it as if it was an external hard disk (as expected, nothing new). The only thing is to make sure that the share is mounted before iTunes starts up, otherwise iTunes will fall back to the default location for music files on your local hard drive. For this, I created an AppleScript that first mounts the share, and then starts up iTunes.

Then I copied the whole iTunes folder (~/Music/iTunes, now without all the music files, but with all the library data) to my iBook, in the exact same relative location. I also copied the com.apple.iTunes.plist from the Preferences folder. So this way, my iTunes application shows up and behaves the same on both computers. Nice.

The next thing was to automatically synchronize this data on a regular basis, so newly added files on my iMac would also show up in iTunes on my iBook. There are many ways to do this; I chose to use Djà Vu.

My router supports dynamic DNS, so I subscribed to dyndns.org to make my ever-changing IP number easily accessible from anywhere with myname.dyndns.org. I Then applied some port forwarding on ports 137-139 (SMB) to my Ethernet disk.

Now on my iBook (and this was my own magic moment!), I established an SMB connection at work to the Ethernet disk share at home. I did this by typing Command-K (or Go: Connect to Server) in the Finder, and then entering the path to the disk:
smb://username:password@myname.dyndns.org/nameofmyshare
The share appeared on my desktop, and iTunes just recognizes it as a normal network share. Voila! This way I even can edit lyrics, artwork and ID3 tags from my iBook at work. Keep in mind that playlists and 'last played' information, etc., created on the iBook will be overwritten by the next synchronization, because that sort of information is stored in the iTunes Library file.

There are a few questions, though. Would the above also be possible via AFP or FTP? Is it safe / secure (SMB with password)? I assume not: last week, I left port 137-139 open for a couple of days, and suddenly there was a bcvsrv32.exe on my share. Glad i'm not on Windows...
    •    
  • Currently 1.80 / 5
  You rated: 2 / 5 (5 votes cast)
 
[35,113 views]  

Play iTunes from anywhere via SMB | 12 comments | Create New Account
Click here to return to the 'Play iTunes from anywhere via SMB' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Play iTunes from anywhere via SMB
Authored by: Spiken on Feb 14, '06 08:17:35AM

You can always tunnel the trafic over SSH, becouse SMB-passwords isn't safe. Other then that it's excatly how I listen to my iTunes Library on the go.



[ Reply to This | # ]
Play iTunes from anywhere via SMB
Authored by: foresmac on Feb 14, '06 08:29:34AM

how do you "tunnel" this over ssh?



[ Reply to This | # ]
Play iTunes from anywhere via SMB
Authored by: xkalibur on Feb 14, '06 10:31:16AM

When you say "tunnel the traffic over ssh", are you tunneling SMB or some other protocol (NFS, etc.) using ssh?

I do something similar on my home LAN for a couple accounts to share the music files, but haven't braved opening up ports 137-139 to the outside world yet (I too, would tunnel). Originally I set it up by setting iTunes to "not copy files", and just added from the share. Then I added in the same way on my wife's account. This has the drawback of her not automatically getting anything newly added, nor seeing my playlists. I'm eternally looking for the better way...



[ Reply to This | # ]
Play iTunes from anywhere via SMB
Authored by: blacklighter on Feb 14, '06 08:47:57AM

I'm wondering, how do you run an apple script before you open an application?
I couldn't get the apple script run automatically before I open the application.



[ Reply to This | # ]
Play iTunes from anywhere via SMB
Authored by: hansi85 on Feb 14, '06 09:47:12AM

place 'tell app "iTunes" to activate' somewhere near the end of your applescript.

then, instead of opening itunes directly, launch the script.



[ Reply to This | # ]
Play iTunes from anywhere via SMB
Authored by: kainewynd2 on Feb 14, '06 09:50:08AM

My guess is that he wrote an applescript that mounts the drive and then opens iTunes afterwards and uses that to open iTunes as opposed to running the App directly.



[ Reply to This | # ]
Play iTunes from anywhere via SMB
Authored by: Ansel_Witty on Feb 14, '06 02:33:01PM

The way I do this is with symlinks... I keep all my music, including the Library File on a separate External Drive...

I just made the folder ~/Music/iTunes/ a symlink to the folder on the external drive and iTunes just works exactly as if the folder was local. This gives me two big advantages, the first is if I decide to take my external drive with me, it is simple to have my music all available to me on the next computer by making one symlink on the new computer. It keeps all of my music in sync and also gives me all my ratings and playlists. It is also still linked with my iPod so if I plug it in on the new computer it automatically updates. This would solve one of the poster's problems with not being able to show the playlists to his wife and updating... It would mean you guys both shared the same music and would only work if you only had the Library open on one computer at a time, but it works pretty well for me over a network also...

---
"I don't believe in mathematics!" - Albert Einstein



[ Reply to This | # ]
Play iTunes from anywhere via SMB
Authored by: kgp on Feb 16, '06 11:34:07AM

How do I make a symlink?



[ Reply to This | # ]
Play iTunes from anywhere via SMB
Authored by: flood on Feb 16, '06 10:01:43PM

"The only thing is to make sure that the share is mounted before iTunes starts up, otherwise iTunes will fall back to the default location for music files on your local hard drive."

I did have this problem with my windows itunes connected to my smb share on my mac-mini. To "solve" this problem, I did this workaround... change the security so my user cannot access at all the default folder of iTunes. This way, iTunes cannot change the folder.

I didn't try this on Mac OS X but it should work.

* delete all the content of ~/Music/iTunes then do this :
sudo chown root.wheel ~/Music/iTunes
sudo chmod 700 ~/Music/iTunes

To recover normal functionality, just delete the iTunes folder
sudo rm ~/Music/iTunes



[ Reply to This | # ]
erratum - Play iTunes from anywhere via SMB
Authored by: flood on Feb 16, '06 10:07:18PM

I did a little mistake...
rm is for removing a file... not a folder (rmdir). We should read :

To recover normal functionality, just delete the iTunes folder
sudo rmdir ~/Music/iTunes



[ Reply to This | # ]
Play iTunes from anywhere via SMB
Authored by: mweier on Sep 23, '06 12:31:08AM
i had same problem as you (I was totally sick of iTunes changing my default library to ~/music/iTunes or whatever if the net volume wasn't connected. here's an applescript i cobbled to use instead of double-clicking itunes itself. it first checks whether my network volume is mounted -- if it is, it opens iTunes. if not, it makes sure it's reconnected, then launches itunes. i'm intrigued by the chmod route since my applescript doesn't solve the issue of the volume getting unmounted while itunes is already mounted... if you wantr to use, just customize the volume name and/or procol (cifs vs smb) throughout, as well as in the if statement. in my case, i'm using workgroup as the workgroup, mamecade as the server name, music as the shared folder and mweier as the user i connect with (pw comes from keychain, presumably) any AS guru's who want to streamline, go for it!

 


tell application "Finder"
activate
if exists disk "MUSIC" then
tell application "iTunes"
activate
end tell
return
end if
try
mount volume "cifs://workgroup;mweier@mamecade/music"
on error
beep
display dialog
"Couldn't find music" buttons "Cancel" default button 1 with icon caution
end try
repeat until (list disks) contains "MUSIC"
end repeat
tell application "iTunes"
activate
end tell
return
end tell


[ Reply to This | # ]
Play iTunes from anywhere via SMB
Authored by: mr.quinn on Jun 18, '07 02:21:14AM

This is an interesting hint, but I am having a few problems with it.

I set up an SMB share on one Mac, using SharePoints, it shares the ~/Music/iTunes folder as ITUNES.

On another mac, I renamed ~/Music/iTunes to ~/Music/local-iTunes then mounted the share : smb://username@machine.local/itunes

I then made a Sym Link :

ln -s /Volumes/itunes ~/Music/iTunes

Launched iTunes.app and everything behaved as expected.

The problem is that now the ITUNES volume will not dis-mount after I quit iTunes.

The icon remains in the Finder, clicking the eject button does nothing. The entry for the volume is still in /Volumes.
I put the server to sleep, the client mac came up with the disconnected warning, but the Finder etc. still has the volume there.

Any ideas ?



[ Reply to This | # ]