Skip to main content

Raspberry PI Samba Raspbian and Sonos Era 100 - Solution

  • August 28, 2026
  • 4 replies
  • 22 views

Hello SONOS-USERS,

I tried a few things today to get Sonos to accept the music library from my Samba share without aborting after a short time with an error stating that the share is no longer available. Most of the information I found used outdated configuration settings or was incorrect. Here is the complete Samba Sample-Configuration:

/etc/samba/smb.conf

# Sample-Config for Sonos and Samba
[global]
bind interfaces only = yes
interfaces = YOUR.RASPI-IP-Adress eth0

# Logging
log file = /var/log/samba/log.%m
logging = file

# Auth / Compatibility
ntlm auth = ntlmv1-permitted
server min protocol = SMB2
server max protocol = SMB3

# ID Mapping
idmap config * : backend = tdb

#======================= Share Definitions =======================

[MP3-Musik]
comment = MP3-Musik
path = /media/musik
valid users = Your-MP3-Music-USERNAME
create mask = 0444
directory mask = 0555

Next, the user must be created correctly:

sudo useradd -M -s /usr/sbin/nologin YOUR-MP3-Music-USERNAME
sudo smbpasswd -a Your-MP3-Music-USERNAME
sudo smbpasswd -e Your-MP3-Music-USERNAME

It is important that the files and folders in /media/musik are owned by the user Your-MP3-Music-USERNAME and are at least readable by everyone.
sudo chown -R Your-MP3-Music-USERNAME:Your-MP3-Music-USERNAME /media/musik

and then set everything to read-only:
sudo chmod 444 /media/musik/*

Finally, check if the Samba user exists:
sudo pdbedit -L

It should display:
Your-MP3-Music-USERNAME:1001:

Also, check the Samba user details. Important points:
Account Flags: [U] → User active
Account Flags: [D] → User disabled
Password last set → Password exists

Check if the user exists as a Linux user:
getent passwd Your-MP3-Music-USERNAME

Sonos loses the connection if the share is unreadable.
Sonos loses the connection if the path is too long.
Sonos has a hard limit: max. 256 characters per path and max. 65,000 files per library

Sonos loses the connection if the path does not exactly match the share name.
Specifying the shared folder in the Sonos app is crucial. You must enter the correct path obtained from `sudo pdbedit -Lv MP3-Musik` here; for example, the output looks like this:

...
Home Directory: \\RASPBERRYPI4\mp3-musik
...

In this case, `\\RASPBERRYPI4\MP3-Musik` must be used as the shared folder, and you must ensure that the username and password and Share MP3-Musik are entered with the correct capitalization (case-sensitive) without the []-Brackets from the smb.conf.

Now: Enjoy your Music.

 

This is just a brief guide, as I couldn't find the necessary information elsewhere. It could certainly be improved, but it is sufficient for the purpose of local music playback via Samba.

I hope you have fun and success with Sonos.

4 replies

  • August 28, 2026

Thank you! I was planning on setting up a Raspberry PI for testing. This will surely help. The only thing that looks off is:

and then set everything to read-only:
sudo chmod 444 /media/musik/*

 

That will sure make it difficult to maintain/add/change the music library. Is that really needed? I usually use 664. 


  • Author
  • Contributor I
  • August 28, 2026

Hello kdowling,

thank you for your >Comment. Personally, I prefer to stick to read-only mode. I wouldn't want all the music to disappear...A user with higher privileges can add music at any time. The owner of the MP3 files is the decisive factor.

 


  • August 28, 2026

Wouldn’t 444 at the file system level mean only those using sudo (or su/root) can change anything?


Stanley_4
  • Grand Maestro
  • August 28, 2026

My setup is a lot simpler and doesn't need a user created and has been stable that way for some time. It is very old but still working fine.

https://stan-miller.livejournal.com/650.html

[music]

Comment = Pi shared folder

Path = /mnt/music

Browseable = yes

Writeable = Yes

only guest = no

create mask = 0555

directory mask = 0555

Public = yes

Guest ok = yes 

 

Change the writeable if you want the share read-only.

Something to consider adding is the CATIA translation function to convert Linux filenames to ones that are SMB compatible. That is covered in the October 23 update to my instructions.