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 :-)
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
sudo adduser sonos
sudo passwd sonos
and enter a new password.
Check that user sonos can read your music files
su - sonos
check you have Samba installed
dpkg --get-selections | grep samba
If you have it returns
If not install it with
sudo apt-get install samba
Back up the config
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.orig
then create /etc/samba/smb.conf to look like this
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
valid users = sonos
read only = yes
printable = no
only guest = no
and create a samba users file /etc/samba/smbusers
to look like this
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:
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
sudo /etc/init.d/samba restart
Check it's working
sudo vi /var/log/samba/log.?mbd
Tell Sonos about the music
On the laptop, install Wine
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.
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
(check that there hasn't been a new release)
tar -xzf sonosweb-0.72.tar.gz
I you get an error about
Can't locate SOAP/Lite.pm in @INC
then you need to
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
sudo mv sonos /usr/local/share
And now prepare to run it in the background
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
On the laptop you should now be able to point a browser at http://server:8001 and away you go!