Synology SMBv1 Docker container workaround

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

@afawaz and anybody else that’s getting the error “failed to create the macvlan port: device or resource busy” - the issue is most likely because you’re using an incorrect network device. If you have vSwitch enabled (a must if you use Virtual Machines on Synology), you can’t use eth0 because it won’t have the ip address of your Synology. You’ll need to prefix your network device with ovs_

 

Ex. Instead of using parent=eth0 when creating your macvlan try using parent=ovs_eth0

 

Here’s a post that helped me find the link between this issue and vSwitch. I recently installed VMM on Synology and ran into this issue and removing macvlan and redoing it with ovs_eth0 fixed it.

 

Like @jelvank said - use the ifconfig command and search for the network device that has inet addr:{your-synology-ip-here} and use that network device in your macvlan configuration.

Very interesting - many thanks...

I found the answer by myself.

could you share please what was the solution :) 

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.

Userlevel 7
Badge +23

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

Badge +1

@jelvank everything is still running and streaming music perfectly. Again thanks for this secure work around.
I have added some folders in my /Music folder, I go to Sonos and tell it to update music library, it shows indexing, it finishes indexing yet none of the new folders or music are showing in Sonos. Any idea why?
I’ve stopped and re-started Docker. Closed and re-opened Sonos app on my macbook pro. Nothing seems to allow Sonos to update.
If I’m reading the below screenshot, is everything r/w?
 Here is a screen shot from ls -alF

 


 

sudo docker network create --driver=macvlan --gateway=192.168.0.1 --subnet=192.168.0.1/24 --ip-range=192.168.0.240/28 -o parent=eth0 macvlan

 

 

Jelvank just wanted to write and say THANKYOU. This is a brilliant solution and seems to work flawlessly. Even someone who shouldn't be trusted with a command line like me can follow it!

Only thing I had to change for mine was because my synology uses a Bond (2 ethernet ports in 802.1ad).  I changed eth0 to bond0 in the above and it worked fine

Thankyou so much for going to all this effort to make it clear and easy to follow.

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. 

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

I'm stuck. I am a complete noob when it comes to command line. I have never done it on my new Synology DS920+ or previously my old DS412+. I am trying do the Sonos workaround and I just can't figure it out.

How do I know what IP address the Docker uses my IP range is 10.220.30.xxx, so I can point Sonos to it, plus I have 2 folders with music.

1. is Music and 2. HD Music AIFF. I tried to do share 
SHARE = music;/music;yes;yes;no;sonos;;;SonosMusic and SHARE = music;/HD Music AIFF;yes;yes;no;sonos;;;SonosMusic

 

Docker didn’t like the 2 shares so I did SHARE = music;/HD Music AIFF/music;yes;yes;no;sonos;;;SonosMusic

 

Like I said, I’m a complete noob at this! 

Hi

Working on this now.  Hopefully works in my environment.

Can you have this work when utilising a custom domain?  Say I have a domain specialdomain.dyndns.org.  I have another Sonos system at work, and I would love to be able to have the music library pointing to specialdomain.dyndns.org/music so I can access this share from externally.   What port to open to access this??

Thanks

Andrew

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.

Hi all,

I followed the instructions in this post and had the same issue that AndrewKorn faced. Using the link above, I did an ifconfig -a and verified that my virtual network adaptor is named ovs_eth0. So I used this in place of just eth0 and voila, everything is up and running.

Thanks heaps Jelvank for sharing your workaround. It has given my 2 Sonos speakers a new lease of life.

hewmf

Userlevel 3
Badge

Hi

Working on this now.  Hopefully works in my environment.

Can you have this work when utilising a custom domain?  Say I have a domain specialdomain.dyndns.org.  I have another Sonos system at work, and I would love to be able to have the music library pointing to specialdomain.dyndns.org/music so I can access this share from externally.   What port to open to access this??

Thanks

Andrew


I seriously advise you not to do this! You will have to expose your share to the outside world to get this to work. I would never expose a samba share to the outside world and especially not if it is SMBv1, known for its serious security issues.

Userlevel 1
Badge

So, I just ran an experiment with my new laptop: I turned off the Windows Feature SMB 1.0/CIFS (I had previously turned it on). I then asked the SONOS app to index my Windows Music folder. It worked fine, and, in fact, was the fasted indexing I have ever experienced. Music played fine. Why does this work without SMB1 activated? I thought the SONOS system needed SMB1.

I was about to buy a Sonology DS220+ (It’s already in my Amazon cart!!!), but this thread is scaring me away from that. 

Userlevel 1
Badge

OK, thanks for the clarification. I have an ancient Buffalo NAS that can only use SMB1. I can see the folders on that NAS if I have SMB1 activated on my laptop, and I curate the music there using MusicBee, After that step, I use the SONOS app to map that Music folder to be the library for SONOS, and it can see that folder, indexes it properly, and plays the music on the zones properly. I only store music, not data, on that NAS. I then deactivate SMB1 on my laptop. I presume that SONOS is using SMB1 to communicate with the NAS on my LAN.

Question(1): Is that any kind of security risk for my network?

Question(2): Seems like an app running on a modern, nonSMB1, NAS could also use SonosLibraryService if it was configured to do so. Not possible?

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

 

 

 

Hi

 

The macvlan network seems to have been created:

 

Thanks


Andrew

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.

vSwitch is off unfortunately.

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

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 4
Badge +1

Hello,

Need a little here in configuring this. As a background, I have been trying to fix this issue for 2 days, going nuts. Definitely not a beginner, I use Docker for work etc. But whatever I do, Sonos says that access to my synology is denied.
As a side note, I have also tried to apply the changes described in this thread, without success.

Where I am: from a Windows file explorer, I see everything, my music is there.
From inside Docker, all the env seems to be in place:

sudo docker exec -ti dperson-samba1 env

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

HOSTNAME=dperson-samba1

TERM=xterm

GLOBAL=ntlm auth = ntlmv1-permitted

SMB=disable

SHARE=music;/music;yes;yes;no;sonos;;;SonosMusic

USER=sonos;hiddenpassword:-)

HOME=/root

There is no other device on my LAN using the same IP address as my container (and again, Windows sees all my samba folders without any problem).
My Synology Firewall is off.

My Sonos devices are a ZP80 and ZP100.

Any clue as to what to check next? Thanks!

Userlevel 7
Badge +23

Question(2): Seems like an app running on a modern, nonSMB1, NAS could also use SonosLibraryService if it was configured to do so. Not possible?

Technically yes, but it requires the PC to be on all the time, which kind of defeats the point of the NAS: just put the files on the PC itself instead.