Synology SMBv1 Docker container workaround

  • 18 October 2020
  • 73 replies
  • 9397 views


Show first post
This topic has been closed for further comments. You can use the search bar to find a similar topic, or create a new one by clicking Create Topic at the top of the page.

73 replies

Thank you, @jelvank! Excellent post.

I was about to enable SMBv1 on my NAS when I saw your post. Everything works perfectly.

It’s a shame that Sonos forces us to go through these workarounds.

Userlevel 3
Badge

@jelvank yes I did, each version I would go add the folder under Volume

Ok, maybe description should be unique too. Your SHARE= comment basically consists of a lot of fields:

name;/path[;browse;readonly;guest;users;admins;writelist;comment]

So in your case try changing SonosMusic to SonosMusicAIFF:

HD_Music_AIFF;/HD_Music_AIFF;yes;yes;no;sonos;;;SonosMusicAIFF

 

Badge +1

Well, everything was working like a champ THANK YOU!!!!  Until I upgraded HDDs on my NAS, the ones I had in service were 7 years old, so I figured it is a good idea to get “modern” HDDs. In doing so I backed up my old drives, but the Docker setting didn’t get backed up somehow.

I’ve redone the docker and I get connected to the folders in docker (music and hd_music) via Mac Finder no problem and Sonos shows I’m connected too. 

The problem is when I view either folder in either Mac Finder or Sonos (to create new playlists or just browse in Sonos) neither of my folders show any files. 

I can go directly into DiskStation or Mac Finder and view the folders and files fine. I can play songs the whole bit. 

Any idea why through docker  or Sonos neither folder shows any files? 

Userlevel 1
Badge

Well, I think I’m in a good place now: I did get that new NAS (Asustor AS5202T 2-bay), and I have successfully moved my Music Folder over to it. Using SMB1 enabled, I set up a new library in the SONOS app that points to the Music folder on the NAS. As long as I don’t want to change the structure of the SONOS library, I can disable SMB1 and still update the music files and the .m3u playlist files just by copy things from my PC to the NAS. I then re-index the SONOS library, and I don’t need SMB1 to do that step. Seems to work fine. Thanks for your insights and suggestions on all this. 

Badge

I followed this (substituting my subnet of 192.168.1.1), and was able to connect to the share with my PC and sure enough the folder ‘music’ was there, but when I tried to add a Sonos library I get the error “Unable to add the shared folder “//192.168.1.240/music/” to your Music Library (900)

Badge

Ignore my above comment, finally got it working. I hadn’t added the “SMB - disabled” environment variable.

Thanks for a helpful solution, @jelvank and all the others who chimed it. We had it working for several months, but then we moved to a new place with a new router.  The NAS and the new router are both from Synology.  The old router from Starry had a different subnet, so we recreated the macvlan and then recreated the sonos-samba container. For a while, we couldn’t even ping our new music library IP address, 192.168.1.240, but changing the macvlan parent from eth0 to eth1 fixed that.

Now, we are getting “connection refused” on 192.168.1.240/music. Regular file access to the NAS is fine.  What could be missing in our Docker or network setup for Sonos?

Any suggestions would be much appreciated.

Badge

Hello
Very interesting post.
Connection to a Synology NAS with DSM 7 ist not possible anymore.

I was just wondering: is the SAMBA solution with Docker 100 % secure?

Thanks.

Userlevel 3
Badge

 

Your share settings have to be added on the Environment-tab.

Although you might add the share as a public share, I prefer to use passwords anyway. Please make sure you use a generated password that you don’t use anywhere else!

 

Following Environment variables have to be set:

PATH 	= leave as is.
GLOBAL = ntlm auth = ntlmv1-permitted
# this will enable old authentication mechanism, necessary for Sonos
SMB = disable
# This will enable SMBv1
SHARE = music;/music;yes;yes;no;sonos;;;SonosMusic
# This is will add a share music, located at /music (location where you mounted your local music on the Volume page), read-only accessible for user sonos with description SonosMusic.
USER = sonos;verysecretgeneratedpassword12345

 

Hi Jelvank, 

 

Thank you so much for this, absolutely stellar!

I have one question… as a SSH and Docker noob, I have been copy-pasting your environment variables to the letter.. literally setting my pasword to:”verysecretgeneratedpassword12345”… Is there a way to chance this password afterwards without going through the whole process from the start?

 

Many thanks!

 

Bastiaan


Hi Bastiaan,

Yes, you can do so easily:

  • Open Docker
  • Hit Container
  • Stop your Sonos-container by switching the button behind the container, wait for it to stop.
  • Hit Edit
  • Go to the tab Environment
  • Down below you will find the variable user. First part is the username and behind the semicolon your very secret password waits for you to be changed :-)
  • Hit Apply, close the Edit window and start the container again by switching the button.

 

Hello, same issue with the container ! 

failed to create the macvlan port: device or resource busy ! 

DS918+ !

no vswitch ! 

I have the following errors:

2021-07-10T00:58:29+02:00 SNas docker[21750]: time="2021-07-10T00:58:29.986777470+02:00" level=warning msg="macvlan driver does not support port mappings"
2021-07-10T00:58:29+02:00 SNas docker[21750]: time="2021-07-10T00:58:29.986864355+02:00" level=warning msg="macvlan driver does not support port exposures"
2021-07-10T00:58:30+02:00 SNas docker[21750]: time="2021-07-10T00:58:30.662053562+02:00" level=error msg="5b3661d101af2050d5ef267be5f529f3347acd847b4cbad6572b5ae1fb3aa410 cleanup: failed to delete container from containerd: no such container"
2021-07-10T00:58:30+02:00 SNas docker[21750]: time="2021-07-10T00:58:30.662195774+02:00" level=error msg="Handler for POST /containers/sonos-samba/start returned error: failed to create the macvlan port: device or resource busy"

any idea ?

An update for those who are using Synology NAS running DSM 7.x.

Default settings means SONOS does not work with Synology shared folders as they require minimum of SMB2 / NTLMV2. However if you go to  File Services > SMB > Advanced Settings > General. Make sure minimum SMB protocol is SMB1 and then Advanced Settings > Others set the “Enable NTLMV1 Authentication” flag. You will get a warning about security issues accept and clear SMB Cache on the General tab.

This enabled the insecure SMB1 and my SONOS was able to connect to the shared folder. I also created a special user and restricted it to the music shared folder to mitigate the crap protocol SONOS forces us to use. 

 

This is ridiculous SONOS that an insecure protocol that was replaced years ago is still the only option in SONOS.  

Badge +1

@jelvank, Should there be a user “Sonos” in users? If so, there is not. The default guest account is set to read only, however when I set up my new HDDs in the NAS I had it diesabled, did Docker change this? 

I can do command line, IF it is done for me, such as your instructions for macvlan…..other than that, no I cannot. 

Thank you for the continued support of this fix….Sad Sonos won’t get off their butts and make a permanent solution 

Using Plex as a Sonos SMBv1 Workaround
I have a WD My Cloud PR2100. I’ve always hated using SMBv1 to run my music library on Sonos from the PR2100. I’ve kept the NAS off the internet to provide some security but that’s not ideal. WD recently updated their OS (OS 5) allowing SMB2&3 or SMB3 only, but I still have to set in on SMB1,2,3 and use NTLMV1 to run a Sonos music library from the NAS. NOT SECURE.
I’ve also seen the Raspberry Pi solution on this and other community discussions but didn’t really want a separate device. So, I thought I’d try to mount my music folder in a Docker container running SMB1, as suggested by the OP on this post. I got the macvlan network running and was able to see the mount in the dperson/samba container from Windows 10 or Mac OS but the folder was always empty no matter what I tried. Maybe a permissions problem or something else. I don’t know Docker or Linux at all, so it was a learning experience for me.
Then, I realized that Plex might work. Plex doesn’t require SMB1 and serves as a media server for music. Importantly, you can set up Plex as a service on the Sonos App. You don’t need Plex Pass for this to work, so it’s free. One draw back is you need to open a port on your router and enable Plex Remote Access for this to work. I think this is an acceptable security risk because :

  1. Plex apps support secure connections with SSL secure certificates
  2. I did not have to turn on UPnP on my router to enable Remote Access in Plex, which would create security issues. Instead, I used manual port forwarding on my router.

On my router, I mapped a WAN/External Port (TCP) number I chose and the external (public) IP address to a LAN/Internal Port 32400 (TCP) and my NAS’s IP address (needed to set static IP address for NAS on router so IP address doesn’t change). Plex has good instructions on their web site for enabling Remote Access with manual port forwarding in the Plex Media Server. Seems like a reasonably secure set up. Certainly better than leaving SMB1 active!
I already had the Plex Media Server (App) running on my NAS to stream movies from the NAS. I loaded my music folder into Music Library on the Plex Media Server and enabled Remote Access with the WLAN port I chose as per the instructions on the Plex web site. After some wonky behavior where I had to hit “enable” and “retry” twice, Remote Access was “fully enabled”.
After this, I added the Plex service on the Sonos App and logged into my Plex account. Once logged in I could see and play my music that I loaded to Plex earlier. Next I turned off SMB1 on my NAS and all my music was still available through Plex on the Sonos App. Also, searching in the Sonos App finds my music in Plex service like any other service in the app.
So, using Plex, my local music library on my NAS is streamed to Sonos using the Sonos App without running SMB1! I’ve had this running for only a day, so don’t know how stable the set up is. Don’t expect any problems though.

Hi Jelvank,
Thanks for your solution to get around this Sonos issue.
Unfortunately, I have managed to create the Container & Macvlan as set out in your instruction, but it does not lead me to the site where I put Sonos as my USER and then my password (I will change this after) - I have beentrying with     //192.168.1.240/
Below I have placed my screen prints which could show where I am going wrong…….I appreciate any help you could share on my situation - Thanks M
 

 

 

 

 

 

 

 

 

 

@Rowena B.Just to clarify, I was able to get my Sonos to talk to my NAS by creating a separate server using outdated and insecure protocols.  Sonos MUST fix their SMB protocol - users should not have to go to these lengths just to listen to their own music.

Just use a PC or a Mac to host your files: no SMB required.

I second that. Moreover, hosting the files on my Mac mini offers me a better playlist management :yum:

 
Userlevel 2

 

Your share settings have to be added on the Environment-tab.

Although you might add the share as a public share, I prefer to use passwords anyway. Please make sure you use a generated password that you don’t use anywhere else!

 

Following Environment variables have to be set:

PATH 	= leave as is.
GLOBAL = ntlm auth = ntlmv1-permitted
# this will enable old authentication mechanism, necessary for Sonos
SMB = disable
# This will enable SMBv1
SHARE = music;/music;yes;yes;no;sonos;;;SonosMusic
# This is will add a share music, located at /music (location where you mounted your local music on the Volume page), read-only accessible for user sonos with description SonosMusic.
USER = sonos;verysecretgeneratedpassword12345

 

Hi Jelvank, 

 

Thank you so much for this, absolutely stellar!

I have one question… as a SSH and Docker noob, I have been copy-pasting your environment variables to the letter.. literally setting my pasword to:”verysecretgeneratedpassword12345”… Is there a way to chance this password afterwards without going through the whole process from the start?

 

Many thanks!

 

Bastiaan

Userlevel 3
Badge

Thanks so much for bringing this here - insane we have to do this but so it goes.

Hoping someone can help.  Setup looks reasonable.  The macvlan starts and looks good.  The package is running fine with the config as specified. The ip range is what I use so it should all be kosher. Only issue is after trying to log in on windows I get no response and using the sonos app I get “The computer 192.168.0.240 is not responding”.  Anything else I can check to see if this is being blocked by Sonology, by my router, or somewhere else?  I’m running a UniFi network, FWIW.


I'm on Unifi as well and I can’t remember running into specific issues with this. Can you ping 192.168.0.240? (I can). Maybe you isolated your Sonos devices somehow? Or your Synology? You can even start a terminal (Container > Details > tab Terminal > Create-button) and try to ping from within your Samba-container.

Userlevel 3
Badge

@Joeschmoe no there's no Sonos user on Synology. Your Synology is not aware of what is going on inside the Docker container. That is more or less the cool thing about containers. But you should try setting your Music share (if that's where your music is located) to world readable.

As to command line. I think this one is pretty simple. Open your Docker container. Choose the Terminal tab and click Create (the button itself, not the arrow). Then you simply enter the commands given above and post the output here. It should show something like this:

Thank you for the continued support of this fix….Sad Sonos won’t get off their butts and make a permanent solution 

Yeah well, what bothers me a bit is that lately Sonos seems to be pointing people here. Maybe they could offer some support themselves if they think this is the way to go...

Userlevel 7
Badge +22

Good news, I like any SMB v1 solution that does not involve running SMB v1 on your NAS that has important data on it.

Badge +1

@jelvank yes currently only using my shared folder /music, I still the HD_Music folder, just not messing with it, until I get this issue resolved. 

Here is a screen shot of the terminal results. 



Sonos is actually directing people to this thread?? WOW!! Pathetic support! When they (Sonos) first came on the scene, they were all about the end users, that has sadly changed, 

Userlevel 5
Badge +16

Hi @samward, thank you for your feedback and we appreciate it. I'm glad that your Sonos is working perfectly

Please feel free to reach out to us if you have questions or if you need help with your Sonos system.

We will be glad to assist you.

Thanks for tutorial. I can’t connect to my share. Something with environment variables I think.

My routeur address is 192.168.10.1 so I’ve modified the local dhcp range.

Could you help me ?

 

Found the solution ! Issue was on GLOBAL variable

I found the answer by myself.

Jelvank - thank you for coming back to me! 
‘ipconfig’ result shot:
 

​​​​​

My router is the following and the synology NAS and Linksy Velop mesh is are attached via ethernet cables:
 

 

I have tried the backslash address that you have suggested and it cannotbe found:
 

I have changed the containerpassword in Docker, so there isn’t any carachters like @ included as below:
 

I very much, like many here, appreciate the kind service you are doing here as this situation with Sonos is very upsetting. If you have the time to correct me where I am going wrong then I would very much appreciiate that…. 

What did you do to fix?  I had the same error.