I have a Linux server running Debian, a close relation of Ubuntu and a laptop running Ubuntu. I bought a Sonos ZP90 but not the controller. I found various bits and pieces on the internet on how to get this working but no complete howto so I thought it would be useful to others if I created a detailed guide for Google to find :-)
Physical set-up
The Sonos and server are connected to my ADSL modem with ethernet cables. The laptop connects via wireless.
Sharing the music
On the server create a new users sonos
code:
sudo adduser sonos
sudo passwd sonos
and enter a new password.
Check that user sonos can read your music files
code:
su - sonos
cd
ls
cd
ls
exit
check you have Samba installed
code:
dpkg --get-selections | grep samba
If you have it returns
code:
samba-common install
If not install it with
code:
sudo apt-get install samba
Back up the config
code:
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.orig
then create /etc/samba/smb.conf to look like this
code:
[global]
workgroup = server
netbios name = server
server string = Samba Server %v
load printers = no
log file = /var/log/samba/log.%m
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
interfaces = lo eth0
security = user
password level = 12
username level = 12
encrypt passwords = yes
username map = /etc/samba/smbusers
[musicshare]
path =
valid users = sonos
read only = yes
printable = no
only guest = no
and create a samba users file /etc/samba/smbusers
to look like this
code:
root = administrator admin
nobody = guest pcguest smbguest
sonos = sonos
This next is a new feature for Samba that some of the older howto's didn't need:
code:
sudo smbpasswd -a sonos
and enter a password. This is the one you will use below during the Sonos set-up.
Restart samba to use the new config
code:
sudo /etc/init.d/samba restart
Check it's working
code:
sudo vi /var/log/samba/log.?mbd
Tell Sonos about the music
On the laptop, install Wine
code:
sudo apt-get install wine
Insert the Sonos installation CD, open it with file browser. Right click on setup.exe and choose "open with Wine Windows Program Loader". Follow the usual install instructions. (If the application can't find your Sonos device then try connecting the laptop to your network using an ethernet cable and turn off your wireless connection. This is only necessary for the initial discovery steps.) On the "select music source" page choose "add music stored in folders that are currently shared on my network".
- Path: \\server\musicshare (replace "server" with the hostname of your server)
- User name: sonos
- Password: whatever you typed at the smbpasswd command above
and you should be in business. If not you might get some useful debug from the error message that Sonos gives you.
Web interface
At this point you should be able to play music using the Sonos controller on the laptop running under Wine. However if you have multiple users on your laptop you will have to install it for each of them. For this reason or just because you prefer a web interface you can install the lovely software Sonos web controller.
On the server
code:
wget http://www.purple.org/sonos/sonosweb-0.72.tar.gz
(check that there hasn't been a new release)
code:
tar -xzf sonosweb-0.72.tar.gz
cd sonos
./sonos.pl -config
I you get an error about
code:
Can't locate SOAP/Lite.pm in @INC
then you need to
code:
sudo perl -MCPAN -e "install Data::Dumper"
sudo perl -MCPAN -e "install SOAP::Lite"
sudo perl -MCPAN -e "install LWP::UserAgent"
sudo perl -MCPAN -e "install HTTP::Daemon"
sudo perl -MCPAN -e "install XML::Simple"
sudo perl -MCPAN -e "install HTML::Template"l
which takes a while. Ignore any errors you might get.
For sonos config select the defaults apart from "location on local disk that Sonos indexes" which you should change to point to where you have your music. Install the software
code:
sudo mv sonos /usr/local/share
And now prepare to run it in the background
code:
screen
cd /usr/local/share/sonos
./sonos.pl
If it starts happily then you can do "ctrl-a d" (ie press control and the "a" button at the same time then just the "d" button) to detach from the session and leave it running. To come back to it use
code:
screen -r
On the laptop you should now be able to point a browser at http://server:8001 and away you go!
Good luck,
Dougal