Synology SMBv1 Docker container workaround

  • 18 October 2020
  • 73 replies
  • 9371 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

Userlevel 3
Badge

I’m sure this is a crazy question, however, where do I change the setting to “world readable”? Somewhere in Docker, or Control Panel> Users and Groups? 

I unselected “Read Only” in docker and no change...

In Control Panel (Synology) → Shared Folders → select folder → edit → tab permissions

And are you sure de location of your music files is still the same?

I don't know if you are used to using the command line, but you can check if your docker container can even see anything by opening a terminal on the terminal tab in your Docker details. Hit Create and enter:

cd /music
ls -alF

This should return a list of all files and directories including ownership and permissions.

(Don't forget to change Read-only back)

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? 


First guess: permission issue. Docker doesn't have access to the folders inside your music folder. Could you (temporarily) change permission to world readable?

I’m sure this is a crazy question, however, where do I change the setting to “world readable”? Somewhere in Docker, or Control Panel> Users and Groups? 

I unselected “Read Only” in docker and no change...

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

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? 


First guess: permission issue. Docker doesn't have access to the folders inside your music folder. Could you (temporarily) change permission to world readable?

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.

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 7
Badge +23

@mogbear based on those screenshots your PC is on an entirely different network to your NAS.

The PC is on 10.102.1.x (which is wireless) and your NAS is on 192.168.1.x

Zero chance these devices can see each other.

I know nothing about dockers (I just put my music on a PC, its trivial to setup and zero maintainance), but that network config is not going to work for Sonos.

 

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…. 

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

Hi @MOGBEAR if you are a windows user, you should try \\192.168.1.240 (note the backslash instead of slash)

Furthermore I think your gateway is wrong, guessing Linksys is your router?

Another suggestion would be not to use @ in your password, since in Linux/Unix world it is a character with specific meaning. Increase the length of the password for security, but avoid special characters.

And finally, please post the output of ifconfig as I mentioned a few posts above here, to see if eth0 is actually your current network device. 

@jelvank great write-up! I put containerizing this off for almost a year (just got into the Sonos family during late 2020), but your guide made me do it ASAP because, well...I didn’t have any excuses.

Some other words for everybody else:

  • You can definitely do more shares and have your music in different folders. Use SHARE, SHARE2, SHARE3, etc. I have 5 shares and they work perfectly (as long as you do it correctly - make a volume, use that volume name in the share, etc.)
  • If you’re only going to be running this container, I suggest using a very small IP range like /31 instead of /28. /31 does 2 IP addresses and 28 does 8. Small difference, but my IP ranges are constrained because I have a ton of devices on my wifi (smart home things).
  • 512 MB is totally enough. I’m running 24 bit 48 kHz flacs without any issues
  • Using the built-in Sonos library is the only way to get 24-48 flacs playing on your speakers. Plex is capped at 16 bit. An alternative would be to set up another script using ffmpeg to convert your 24 bit → 16 bit, use Plex with the 16 bit, and call it a day.
  • If you have to delete the macvlan you created, got back to SSH and use the sudo docker network rm macvlan - why would you do this? Maybe you messed up your IP ranges like I did and need to fix it *shrug*

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
 

 

 

 

 

 

 

 

 

 

Userlevel 3
Badge

I wonder if your active network device is actually called eth0. You can check all network interfaces by entering:

ifconfig

Several devices should appear, including a device called “eth0”. This device should be the one with the ip-address your Synology is using:

eth0      Link encap:Ethernet  HWaddr XXXXXXXX
inet addr:IP OF YOUR MACHINE Bcast:X.X.X.X Mask:255.255.255.0
inet6 addr: XXXXXXX Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:28499909 errors:0 dropped:0 overruns:0 frame:0
TX packets:29418188 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:16085430921 (14.9 GiB) TX bytes:23241748739 (21.6 GiB)

If the ip-address you know is behind another device, you should create de macvlan device with the name of that device instead of eth0.

I found the answer by myself.

could you share please what was the solution :) 

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

I found the answer by myself.

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 ?

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

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

Userlevel 3
Badge

vSwitch is off unfortunately.


I'm afraid I won't be of much help here. I suggest trying either Synology or Docker forums.

Userlevel 3
Badge

Have you mounted the folder inside the docker container?

 

Badge +1

I was able to get share=music to work and all music is visible in Sonos, THANK YOU!! :sunglasses:

However, I went and renamed HD Music AIFF to HD_Music_AIFF and then set SHARE2=HD_Music_AIFF;/HD_Music_AIFF;yes;yes;no;sonos;;;SonosMusic

I can’t get this to connect at all. I’ve tried all lower case, but don’t think it is caps specific, I’ve tried HD_Music_AIFF;/HD_Music_AIFF/;music;yes;yes;no;sonos;;;SonosMusic

 

and several other versions and nothing. Any ideas? 

Userlevel 3
Badge

Dear @Rowena B. ,

now that DSM7 is officially launched, i assume more and more people are getting stucked with SONOS SMB1 implementation. I think the solution that has been presented here is technically very good, but not what i expect to do, if i am working with one of the leaders in multiroom entertainment.

So i (and i think the most of your users) would really appreciate any information on when SONOS will update the software and go with  SMB2.


Hi gevaugeh, I agree, but there are a lot of topics with opinions about this. This is a topic about a solution and I like to keep it that way.

vSwitch is off unfortunately.

Userlevel 3
Badge

Hi 

When starting the container with the settings above, I get an error:

Start container sonos-samba failed: {"message":"failed to create the macvlan port: device or resource busy"}.

I followed the information and SSH information in your post.

 

Thanks

Andrew


Could be a lot of things. I know about an issue with macvlan and Synology Vswitch:

https://www.reddit.com/r/homelab/comments/cng2s2/issue_with_synology_vswitch_and_docker_macvlan/

If you use vSwitch you might need to switch it off.