Forum

Full Version: Cannot connect to Samba shares
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello, here's a problem I have with xbian/Kodi I don't quite understand:

I try to populate the music, series, etc. media folders via a samba share residing on a Linux machine. The machine is not being displayed if I chose browse and if I manually enter the remote machine like so:
"smb://ServerName/Sharename/" xbian instantly(!) replies with "Connection timed out".

Now you'll probably say "your share and/or samba are not configured properly", however:
  • I can access mentioned share from a windows machine without problems
  • I have several samba shares on different machines, a raspi-2, a cubietruck, a debian stretch machine (which operates as my tvheadend server), all of them are accessible to the windows machine but none of them can be mapped as a Kodi media folder, always "Connection timed out"
  • If I click on "browse" I see the rotating circle for 2-3 secs and then I'm shown an empty list, no machines are shown at all, the browse list is empty
  • I also cannot connect to a SMB share on the Windows machine in xbian, so this seems not to be a samba problem
  • No dialog appears that allows me to enter any login credentials for any share I try to connect to, the "Connection timed out" massage comes before and it then aborts
  • On the contrary I can connect to mentioned machines if I chose to map via UPnP. So all the machines I try to connect to are visible to my xbian machine via LAN

ANy idea what's wrong here? I'm running xbian on a raspi-3, Kodi 17.5.

BR

Don
Whats the output of sudo cat /etc/fstab
(14th Nov, 2017 02:39 AM)Skywatch Wrote: [ -> ]Whats the output of sudo cat /etc/fstab

You're talking of the xbian machine, right? It's this:

Code:
# UNCONFIGURED FSTAB FOR BASE SYSTEM
none            /run/user                       tmpfs                   noauto                  0       0
none            /run/shm                        tmpfs                   noauto                  0       0
none            /run/lock                       tmpfs                   noauto                  0       0
/dev/root             /home                   xbian   subvol=home/@,noatime,nobootwait,rw           0       0
/dev/root             /lib/modules            xbian   subvol=modules/@,noatime,nobootwait,rw        0       0
/dev/root             /                       xbian   noatime,nobootwait,rw                         0       0
/dev/mmcblk0p1        /boot                   xbian   noatime,rw,private                                 0       1

Should be pretty standard as I didn't mess with fstab

Cheerz

Don
So how are you mounting the samba shares if not via here?
Did you see this? .....

http://wiki.xbian.org/doku.php/samba
(13th Nov, 2017 05:31 AM)Don Pedro Wrote: [ -> ]Hello, here's a problem I have with xbian/Kodi I don't quite understand:

I try to populate the music, series, etc. media folders via a samba share residing on a Linux machine. The machine is not being displayed if I chose browse and if I manually enter the remote machine like so:
"smb://ServerName/Sharename/" xbian instantly(!) replies with "Connection timed out".

Did you tried IP-address? That's working for me. Maybe you have a DNS issue

But anyway, browsing for SAMBA servers does not work for me as well, no idea why.

Tried some days same procedure with my LE 9.x test installation, same result there. Never see my SAMBA servers Sad
(14th Nov, 2017 06:49 AM)Skywatch Wrote: [ -> ]So how are you mounting the samba shares if not via here?

As I wrote, I try to use the GUI functionality from within xbian/Kodi, however this seems not to work. What it does under the hood of course I do not know.

(14th Nov, 2017 06:49 AM)Skywatch Wrote: [ -> ]Did you see this? .....
http://wiki.xbian.org/doku.php/samba

Yes I did, however this describes how you configure a share on the xbian machine. These shares are there and they do work, I can access them from my Windows machine. But what I want to do is access a SMB share on another machine from within xbian. If this means that these shares are written as mountpoints to fstab, well then be it. But obviously the GUI has some problems doing so.

Cheerz

Don

(14th Nov, 2017 07:00 AM)Nachteule Wrote: [ -> ]Did you tried IP-address? That's working for me. Maybe you have a DNS issue

Good point, didn't think of that! So I tried it, but unfortunately it makes no difference, plain IP gives the same connection timeut message.

What I also found out:
  • Strangely sometimes(!) the browse function in xbian does list the available machines, so it did this time, I can see all the machines that do offer SMB shares on my net. Don't know why this sometimes works and sometimes not!
  • But already if I only try to browse one of those machines to list its available shares I get "Connection timeout".
  • I get this error independently if I try to browse a Linux or a windows machine.
  • But wait, there is one exception! I have a Fritzbox and if I try to browse this it doesn't error but comes up with a new screen asking me for the login credentials!

How come?? This is really weird!

(14th Nov, 2017 07:00 AM)Nachteule Wrote: [ -> ]But anyway, browsing for SAMBA servers does not work for me as well, no idea why.

Tried some days same procedure with my LE 9.x test installation, same result there. Never see my SAMBA servers Sad

This seems to be a common problem. The net is full of people having this issue. Maybe this is due to the many ways a windoze machine populates the browse list. hosts file, wins server, broadcasts, master browser, netbios, etc., pp. - with such a chaos of obsolete and not so obsolete techniques things can only get awry...
Again Apple showed them how to do this reliable and with no configuration effort on the participating machines. It is justified they named it "zeroconf"...

Cheerz

Don
(16th Nov, 2017 07:49 AM)Don Pedro Wrote: [ -> ]This seems to be a common problem. The net is full of people having this issue. Maybe this is due to the many ways a windoze machine populates the browse list. hosts file, wins server, broadcasts, master browser, netbios, etc., pp. - with such a chaos of obsolete and not so obsolete techniques things can only get awry...
Again Apple showed them how to do this reliable and with no configuration effort on the participating machines. It is justified they named it "zeroconf"...

Cheerz

Don

Yeah, fully agree, browsing SAMBA server is a big mystery, never worked reliable for me. And now, SMB1 protocol has been dropped, that's producing additional chaos ....
What I also found out:
...
  • But wait, there is one exception! I have a Fritzbox and if I try to browse this it doesn't error but comes up with a new screen asking me for the login credentials!

And this seemingly weird behaviour might lead to the solution! When I thought about it I remembered that fritzboxes are still using version 1.0 of SMB (shame on AVM!). On the other hand I switched all my linux and windoze machine to refuse version 1.0 connection but to insist on a higher protocol level. For an explanation why see e.g. here:
http://www.searchsecurity.de/antwort/Wie-man-den-Risikofaktor-Windows-SMB-in-den-Griff-bekommt (German only).
So the idea now is that if cifs-utils by default insist on version 1.0 these will of course lead to an error!

So the question is: Is there a possibility in the GUI for SMB mappings to enforce SMB protocol version 2.0 or higher?

Cheerz

Don
(16th Nov, 2017 09:23 AM)Don Pedro Wrote: [ -> ]So the question is: Is there a possibility in the GUI for SMB mappings to enforce SMB protocol version 2.0 or higher?

Cheerz

Don

Kodi forum would be better place for that discussion Dodgy

Did you already tried this solution?

Just tested and my Kodi is using SMB3_00 protocol now
(16th Nov, 2017 11:27 PM)Nachteule Wrote: [ -> ]Kodi forum would be better place for that discussion Dodgy

Did you already tried this solution?

Just tested and my Kodi is using SMB3_00 protocol now

Yep, maybe Kodi forum would've been better, but I didn't know that the SMB-client comes with Kodi. And no, I didn't yet try the link, however this sounds very promising! Will try that and report.

THX

Don
(16th Nov, 2017 11:27 PM)Nachteule Wrote: [ -> ]Did you already tried this solution?

Just tested and my Kodi is using SMB3_00 protocol now

Unfortunately and contrary to my expectation this does not work for me! What I tried:
  • Inserted "client max protocol = SMB3" in /home/xbian/.smb/smb.conf, restarted Raspi
  • Additionally added "client min protocoll = SMB2" in /home/xbian/.smb/smb.conf, restarted Raspi
  • Did the same with /home/xbian/.smb/smb.conf, restarted Raspi
  • I found two more smb.conf, /usr/share/samba/smb.conf and /etc/samba/smb.conf, but from the content I concluded that these are used for the server configuration and I left them out
  • Tested temporarily to re-enable SMB V1 on one Linux machine and, whoops, no "Connection timeout" but I get a list of shares and the option to enter the logon credentials

So this is proof that the problem here is in fact that Kodi's smbclient does not use SMB V2 or higher but is stuck with SMB V1! From googling I could determine that this seems to be (or was?) a problem with Android, but not with a "regular" Linux distro - and xbian is "bleeding edge", isn't it? So this does not quite match what I'm seeing here, I'm on Raspberry which is of course Debian ARM, not Android. I'm wondering if there is a way to have Kodi's smbclient use SMB higher than V1. Maybe I should in fact ask this on the Kodi forum...

Additionally I will try to manually mount an SMB folder in fstab via the distro's smbclient/mount.cifs, maybe/hopefully this operates with SMB V2, I will report progress. Such a workaround would be acceptable for me, however IMHO Kodi should start supporting SMB V2 and up, as MS is in the progress of disabling the outdated SMB V1 in the aftermath of Wannacry - which absolutely makes sense, no blame on them.

BR

Don
(20th Nov, 2017 12:39 AM)Don Pedro Wrote: [ -> ]
(16th Nov, 2017 11:27 PM)Nachteule Wrote: [ -> ]Did you already tried this solution?

Just tested and my Kodi is using SMB3_00 protocol now

Unfortunately and contrary to my expectation this does not work for me! What I tried:
  • Inserted "client max protocol = SMB3" in /home/xbian/.smb/smb.conf, restarted Raspi
  • Additionally added "client min protocoll = SMB2" in /home/xbian/.smb/smb.conf, restarted Raspi
  • Did the same with /home/xbian/.smb/smb.conf, restarted Raspi
  • I found two more smb.conf, /usr/share/samba/smb.conf and /etc/samba/smb.conf, but from the content I concluded that these are used for the server configuration and I left them out
  • Tested temporarily to re-enable SMB V1 on one Linux machine and, whoops, no "Connection timeout" but I get a list of shares and the option to enter the logon credentials

So this is proof that the problem here is in fact that Kodi's smbclient does not use SMB V2 or higher but is stuck with SMB V1! From googling I could determine that this seems to be (or was?) a problem with Android, but not with a "regular" Linux distro - and xbian is "bleeding edge", isn't it? So this does not quite match what I'm seeing here, I'm on Raspberry which is of course Debian ARM, not Android. I'm wondering if there is a way to have Kodi's smbclient use SMB higher than V1. Maybe I should in fact ask this on the Kodi forum...

As already told, this would be good idea ... Smile

Quote:Additionally I will try to manually mount an SMB folder in fstab via the distro's smbclient/mount.cifs, maybe/hopefully this operates with SMB V2, I will report progress. Such a workaround would be acceptable for me, however IMHO Kodi should start supporting SMB V2 and up, as MS is in the progress of disabling the outdated SMB V1 in the aftermath of Wannacry - which absolutely makes sense, no blame on them.

I'm using SAMBA shares with autofs for many many years, never had issues with that kind of configuration. Smile

Added my own auto.videos and videos.autofs file into folder /etc/auto.master.d which does a flexible path to server share configuation. This makes (reconfiguration) of shares inside of Kodi obsolete Big Grin
(20th Nov, 2017 03:44 AM)Nachteule Wrote: [ -> ]As already told, this would be good idea ... Smile

Yeah, maybe I will ask there. However the problem is less urgent now, I could indeed mount my shares via etc/fstab as SMB V2.1! So this is the final prove that the internal smbclient of Kodi does support SMB V1 only, which makes it less and less attractive.

Quote:I'm using SAMBA shares with autofs for many many years, never had issues with that kind of configuration. Smile

Added my own auto.videos and videos.autofs file into folder /etc/auto.master.d which does a flexible path to server share configuation. This makes (reconfiguration) of shares inside of Kodi obsolete Big Grin

If I should run into problems with cifs mounts (e.g. due to the network coming up lately?) I will also switch to autofs as you suggested. But I'm already happy that I was able to map an SMB share at all.

BR

Don
(20th Nov, 2017 08:51 AM)Don Pedro Wrote: [ -> ]If I should run into problems with cifs mounts (e.g. due to the network coming up lately?) I will also switch to autofs as you suggested. But I'm already happy that I was able to map an SMB share at all.

I guess I will have to switch to autofs as well! Fixed cifs mountpoints in fstab lead to the effect that my xbian is no longer booting correctly. It comes up till the point where it states "network started" and Kodi hangs then. Luckily it's still accessible via SSH, so I could easily comment out the samba shares again and it boots normally afterwards. So this is not a solution, but autofs sounds as if it can do the trick. Will try and report...

BR

Don
@Don Pedro
(23rd Nov, 2017 08:32 AM)Don Pedro Wrote: [ -> ]I guess I will have to switch to autofs as well! Fixed cifs mountpoints in fstab lead to the effect that my xbian is no longer booting correctly. It comes up till the point where it states "network started" and Kodi hangs then. Luckily it's still accessible via SSH, so I could easily comment out the samba shares again and it boots normally afterwards. So this is not a solution, but autofs sounds as if it can do the trick. Will try and report...

Ehm, I forgot to mention, that if you're using noauto as mount option, that mountpoint will be merged into autofs automagically for nfs, nfs4 and cifs mounts Smile (of course, not only if noauto is set, but it only makes sense if noauto is given)

For example, I'm using

Code:
kmcubie:/usr/src/xbian     /usr/src/xbian          nfs     defaults,noauto                            0       0

in my /etc/fstab for years and XBian is merging this into file /etc/auto.master.d/auto.xbian

Code:
/usr/src/xbian -fstype=nfs,defaults,noauto kmcubie:/usr/src/xbian

Look into file /etc/init/autofs-rebuild.conf, there is the magic code ...
Pages: 1 2
Reference URL's