Kodi Community Forum
Help with Samba - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Raspberry Pi (https://forum.kodi.tv/forumdisplay.php?fid=166)
+---- Thread: Help with Samba (/showthread.php?tid=314964)

Pages: 1 2


Help with Samba - raptorjr - 2017-05-24

Recently I noticed that I can't browse for new Samba shares. Old shares work fine. I Got some help from Milhouse since I'm using the #521 build. But instead of filling that thread with off topic I'm asking for help here.

I want my media computer to be the master samba server. So to the LE smb config I added local master = no, and also min protocol = SMB2.
On my media computer I added local master = yes, min protocol = SMB2, and also os level = 128, I read that a higher number would make it the master if there should be a negotiation. And since LE has 20, the media computer should win. I then restarted nmbd and smbd service on my media computer.

But it still don't work.

If I do this

Code:
sudo nmbd -iFd3 | grep master_browser

I get:

Code:
check_for_master_browser_fail: Forcing election on workgroup STEFAN subnet 192.168.1.10
become_local_master_browser: Starting to become a master browser for workgroup STEFAN on subnet 192.168.1.10
become_local_master_browser: first stage - attempt to register ^1^2__MSBROWSE__^2^1

And I need to quit the SSH session, Ctrl+C don't work.

But when I start nmbd normally I get this in the log:

Code:
*****
  Samba name server TVDATOR is now a local master browser for workgroup STEFAN on subnet 192.168.1.10
*****

Before I started messing around I got output with all my shares when doing smbtree -N, but now I get nothing. Even though the log says that TVDATOR is the master browser.

Old shares still working though, but I messed something up with the browsing that looks a little bit worse now =)

Any help appreciated.


RE: Help with Samba - Milhouse - 2017-05-24

The browsing of servers appears to no longer work once NT1 is disabled on the server that is also your master browser - this seems to be a Samba issue.

You can run "smbtree -N" on the LE client and when NT1 is disabled on the server/master browser you'll get no servers listed. Re-enable NT1 on the server/master browser and you should see all the servers on your network.

My advice would be to enable NT1 on the server, browse you network and add your sources, then disable NT1 again. If you need to add another source in future, temporarily re-enable NT1 on the server.

Edit: Strictly speaking the recent SMB1 (NT1) exploits have been due to bugs in Microsoft's implementation of SMB1, so disabling the SMB1/NT1 protocol on a Unix/Linux server might not be so urgent/critical (but eminently sensible IMHO). Disabling the SMB1/NT1 protocol on a server or PC running a Microsoft OS is the only sensible option - even Microsoft recommend disabling it.


RE: Help with Samba - raptorjr - 2017-05-24

Thank you for your help.

I changed to NT1, and smbtree showed all my media computer shares again. Also changed on LE computer to NT1, and the shares was shown again.

If I do smbtree -N on my LE computer I get:

Code:
STEFAN
        \\TVDATOR                       Samba 4.3.11-Ubuntu
                \\TVDATOR\IPC$                  IPC Service (Samba 4.3.11-Ubuntu)
                \\TVDATOR\Multimedia            Multimedia
        \\LIBREELEC                     LibreELEC
                \\LIBREELEC\IPC$                IPC Service (LibreELEC)
                \\LIBREELEC\Picons
                \\LIBREELEC\Backup
                \\LIBREELEC\Logfiles
                \\LIBREELEC\Screenshots
                \\LIBREELEC\Userdata
                \\LIBREELEC\Configfiles
                \\LIBREELEC\Emulators
                \\LIBREELEC\Pictures
                \\LIBREELEC\Downloads
                \\LIBREELEC\Recordings
                \\LIBREELEC\TV Shows
                \\LIBREELEC\Music
                \\LIBREELEC\Videos
                \\LIBREELEC\Update
                \\LIBREELEC\Temp

But still, when I select browse from Kodi, the list comes up empty. Only ".." is shown.


RE: Help with Samba - Milhouse - 2017-05-24

Did you restart kodi after enabling NT1 on the master browser? You should be able to browse on the client even if negotiating SMB2/SMB3 connections - browsing is only broken (in my experience) when NT1 is disabled on the master browser and it should be possible for a client (that may be capable of connecting with SMB2/SMB3) to browse the network so long as the server speaks NT1. I suspect the "browse network" functionality is independent of any connection that may subsequently be negotiated by the client, but requires NT1 on the server.


RE: Help with Samba - raptorjr - 2017-05-26

Now I tried to restart Kodi, still cant browse from Kodi. smbtree - N shows all my shares, and both client and server speaks NT1. Haven't tried to enable debugging in Kodi.

But this shouldn't be a problem? Works for everyone else?


RE: Help with Samba - Milhouse - 2017-05-26

If NT1 is enabled in the Samba server (FreeNAS with Samba 3.6.12) that is my master browser then yes, browsing is possible (with both smbtree and Kodi) regardless of max protocol configured on the client. Disable NT1 in the server that is master browser and browsing is no longer possible (smbtree shows nothing, Kodi shows only ".."). Different Samba servers/versions may show different behaviour, I guess - it's far from a perfect system.


RE: Help with Samba - raptorjr - 2017-05-27

I guess this happened when I updated to Ubuntu 16.04 and got Samba 4.3.11-Ubuntu. The only thing I can think of that has changed.

So there isn't really anything else I can do to get it working again? Maybe downgrade my samba server. Or could I change the master browser to LE, and would that work?

Not that I'm using it that much, but good to have when I want to add a new share. And I don't like things that are broken.


RE: Help with Samba - raptorjr - 2017-05-27

Didn't think to test Windows, but installed 17.3 on my Windows 10 computer and browsing works there. So it is just the magic with samba or could there be a problem with Kodi running on LE?


RE: Help with Samba - Milhouse - 2017-05-27

Try an older release version of LE, ie. 8.0.2, as that uses Samba 3.6.25 (which supports only NT1) and has been quite reliable. If that works but latest test versions don't, ie. #0526, then it might suggest the Samba 4 client library is to blame. Had to say how/why Windows 10 works but Samba systems don't, that's the problem with undocumented proprietary protocols.


RE: Help with Samba - raptorjr - 2017-05-27

Would it work to downgrade from #526 or should I do a new installation?


RE: Help with Samba - Milhouse - 2017-05-27

You can downgrade, then run "rm -fr /storage/.smb" and reboot


RE: Help with Samba - raptorjr - 2017-05-27

LE8.0.2 works.

Any idea on what version I should start testing to see when the problem started?


RE: Help with Samba - Milhouse - 2017-05-27

(2017-05-27, 15:37)raptorjr Wrote: LE8.0.2 works.

Any idea on what version I should start testing to see when the problem started?
#0328 is the first test build with Samba 4.6.1, subsequent versions have updated through Samba 4.6.2, 4.6.3 and most recently 4.6.4. #0327 should be using Samba 3.6.25, same as LE 8.0.2.


RE: Help with Samba - raptorjr - 2017-05-27

#328 works
#329 don't work


RE: Help with Samba - Milhouse - 2017-05-28

Hmm, the only change in #0329 (as far as Samba is concerned) was the addition of "client max protocol = SMB3" which can be removed by setting "client max protocol = NT1" (as this is the default). However in my network I'm able to browse regardless of the client max protocol setting (so long as the master browser "speaks" NT1).