After Hours

Music server via Samba

Jack Wallen set up a Samba music server for his family's use. He takes you through the setup and configuration to get it working.

With the recent migration from all of our iPods to different types of MP3 players here at home, I found it possible to set up a music "server" so that each member of the family could access our rather large music collection without having to waste cd-rws or having to upload to an ftp server first. No, I wanted each member of the family to simply be able to have a directory (or shortcut/favorite to a directory) that would allow them to access the entire contents of the music library. Enter Sandman. Erm, I mean...Samba.

It was actually quite simple. I've set up Samba plenty of times and knew that it wouldn't take more than 10 or so minutes to get everyone connected. I had a Linux PC (where the library would be housed via an external 115 gig SATA drive mounted to /media/music), a Mac, and a Windows 2000 machine. And now that the iPods were out of the way, iTunes was no longer necessary so each members' MP3 player was either attached as a flash drive or had software (in the case of the Creative ZEN) that would map to the library. NOTE: Yes, I know that iTunes can map to external sources, but I have had enough experiences with iTunes mucking up the file names/structures that I didn't want to chance it.

The Samba setup

Here's the smb.conf file:

[global]
            netbios name = MONKEYPANTZ
            workgroup = MONKEYPANTZ
            security = user
            encrypt passwords = yes
            smb passwd file = /etc/samba/smbpasswd
            interfaces = 192.168.1.1/8
[WALLEN MUSIC]
            comment Wallen music library
            path = /media/music
            writeable = yes
            create mode = 0600
            directory mode = 0700
            locking = yes

After the smb.conf file was correctly working I had to create a global user with the smbpasswd program. To do this, I ran the following commands.

First to add the user:

sudo smbpasswd -L -a familymusic

I was prompted for a new password.

And then to encrypt the users password:

sudo smbpasswd -L -e familymusic

Once those commands were complete, I restarted Samba with sudo /etc/init.d/samba restart and I was able to connect from all machines to the library.

Using the Mac was simple. I opened up the Finder and hit the apple key and "k" combination to connect to a server. I then entered smb://192.168.1.101 which then prompted for the username/password combination (it automatically detected the workgroup name). Once connected, I was able to drag and drop files onto my wife's MP3 player. With my step-daughter's ZEN it was just a matter (with the ZEN's software installed) to navigate to the library, right-click on the directories or files to copy to the device, and select Copy To Creative Zen. Done and done.

What always impresses me the most with Samba is how universal it is. I have yet to come across a problem where I need to be able to access files from multiple types of machines that Samba couldn't solve. Of course the only iHoldover I have is my iPhone. As you can guess, it would not connect to the Samba server. Maybe when the new 2.0 firmware comes out someone will come up with an samba-aware app so that there's a new way to get music onto the phone. That is probably nothing more than wishful thinking.

About

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.

6 comments
brian.mills
brian.mills

I've done the iTunes via Samba method before, with both Windows and OS-X connecting to Samba on my Linux server, and it never seemed to end well. iTunes doesn't seem to like having to connect to the network to see its music, for some reason. Other than that limitation, I quite enjoy the iTunes/iPod setup my wife and I have. I ended up keeping the iTunes library on my wife's iMac (hopefully soon to be replaced by a notebook, leaving it as the "family" computer) and I rsync it to the Linux server for sharing across the network via Firefly Media Server, allowing me to listen to all my non-DRM music no matter what OS I'm using on my client machine. If I didn't have the iPods, my setup would probably be a bit different, since iTunes would also disappear out of the equation, but for now it works like a charm.

mikedyne
mikedyne

Winamp is fully compatible with iPods these days. I'd imagine it could access music via a mapped drive. It can also be used to broadcast to numerous devices (360, PS3, most net capable things etc...) using Winamp Radio.

Dumphrey
Dumphrey

are both itunes replacements that will talk to your ipod natively (and cross platform). Also neither complains about a network repository for music. Yamipod is about the best thing I have seen for working with an ipod outside itunes, and songbird is a nice capable player that can also access an ipod, and play remote files.

pgit
pgit

Check it out, a web based music server. Guests can tap in to it without having to do any networking.

Neon Samurai
Neon Samurai

There is a project that you can install which talks to iTunes in it's own language. With it, the server should look like any other shared iTunes library on your network. I can't remember the name of the program as I'm a ways off from having the box build and will look it up closer to the needed time. Excluding iTunes, I've found Samba fantastic and been using it for years. Having network shares available between my seporate machines is requirnment these days. Like the article, I share my music and family photo albums between machines within my own network. The giant archive can sit in the basement while music, video or slideshows get run on whatever notebook is close by. For Amarok, I got the reverse route. It doesn't like to mount shared directly so I mount the NAS shares too a /media/blah folder then Amarok or any other program can access them directly. Amarok get's it's local workspace but draws the bulk of media from the remote storage. In past, I've just used KDE's file manager when I need read/write access to the NAS but mounting read/write has advantages too.

jlwallen
jlwallen

songbird looks nice. i've yet to get it to see my ipod (haven't spent too much time on it though.) seems like songbird is just a rebuild of firefox to include multimedia support like itunes. i'll look at yamipod as well.