I recently disabled SMBv1 on my server after the WannaCry storm. It immediately killed OSMC’s ability to connect to shares through SMB.
Information how to make Kodi work together with SMBv2/3 is hard to find in one place and the posts are sometimes contradicting each other.
It basically comes down to some additions in the .smb/smb.conf file.
You need to add or change to following 3 settings under the global headline.
[global]
client min protocol = SMB2
client max protocol = SMB3
client NTLMv2 auth = yes
Kodi automatically generates the .smb conf to avoid overwriting the global one.
We can patch Kodi to change the file as per your suggestions, but I think client min protocol should be SMB1. Some people may still rely on SMBv1 with older devices.
Can you confirm if it still works with this change?
Thanks for the post and for bringing this to my attention.
I can confirm that setting the client min protocol = SMB1 doesn’t break connecting with a Samba server running SMB2 and Windows Server 2016.
It did not bring back the browsing functionality.
I agree that for non-enthusiast disabling SMBv1 can be frustrating and the breaking browsing function certainly doesn’t help but at least those who want SMB2 can use this.
Didn’t expect it to unfortunately, but it lets us use SMB2/SMB3 where we can.
Kodi v17 is still focused on Samba 3.x, but the good news is they are moving forward. I believe the WAF based buildsystem has been an obstacle for them. We found this problematic when trying to chase down some regressions in the upstream (Debian) version of Samba.
Apologies if I didn’t make myself clear, I was trying to say thats where you would find it.
Anyway you can edit using nano:
nano ~/.smb/smb.conf
make the changes and ctrl-x to exit and yes to save changes.
Thanks Tom.
P.S
I may be wrong, but I believe smbstatus is installed as part of Samba (SMB) Server. Which shouldn’t be required for connecting to smb shares on another device. If your having issues setting up Samba (SMB) Server, you would probably better starting a new topic.
I’ve successfully modified the file, but Kodi doesn’t appear to respect it.
With SMB v1 disabled on my server, Kodi cannot access the shares.
If I re-enable SMB v1 on my server, Kodi can access the shares, which it shouldn’t be able to given I have client min protocol = SMB2 set.
Do I need to modify the global smb.conf file also?
I’m not familiar with this as I should be, I use NFS for my shares. Any changes made ~/.smb/smb.conf, should be respected without making changes to the global version. Did you restart OSMC after making changes?
Also it may be worth posting ~/.smb/smb.conf, also debugging logs may give us more of an Idea of whats going on.
Well not directly related but you have an issue on your samba packages. you might want to purge all of them and then just reinstall via app-store (if you use the samba server on OSMC at all).
Job for smbd.service failed. See 'systemctl status smbd.service' and 'journalctl -xn' for details.
invoke-rc.d: initscript smbd, action "start" failed.
dpkg: error processing package samba (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.19-18+deb8u10) ...
Processing triggers for systemd (215-17+deb8u7) ...
Errors were encountered while processing:
samba
Log ended: 2017-07-03 15:09:08
The next strange thing is this error which might point to a wrong client version unless there is a typo I don’t see
Jul 03 20:00:29 pi mediacenter[338]: WARNING: Ignoring invalid value 'SMB3_11' for parameter 'client max protocol'
Lastely this error, Connection timed out might have other reasons so I first would check the server side and also server side log.
20:00:45.586 T:1715225584 ERROR: SMBDirectory->GetDirectory: Unable to open directory : 'smb://USERNAME:PASSWORD@BIGBLACKBOX/Videos/Movies'
unix_err:'6e' error : 'Connection timed out'
I tried to install Samba to get the command to show SMB status. Install failed. I don’t need SMB server though, only client.
This is a giant error: This is probably related to my problem.
Jul 03 20:00:29 pi mediacenter[338]: WARNING: Ignoring invalid value ‘SMB3_11’ for parameter ‘client max protocol’
Server works fine if I enable SMB v1 on it. But once I block it, the timeout is instantaneous.
Sorry guys for providing a faulty parameter.
SMB3_11 is not a valid option for every samba configuration. SMB3 should be working for most installations. I changed it in the post.
smbstatus is a command run on a samba server. For a Windows server you can do the same with PowerShell. Use: Get-SmbSession | Select-Object -Property SessionId,ClientComputerName,ClientUserName,NumOpens,Dialect | Format-Table