SMB: error 2 share not available

Hello,

I get the famous « Error 2: share not available » when I try to access my SMB share. I tried all the solutions I could find on this forum and others, but none of them works.

My share is on my Time Capsule (a router with an integrated hard drive, sold by Apple a few years ago - now deprecated). It uses SMB1 (and AFP) protocol (and this can not be changed)

I can access this share with all the devices I tried with, except with my Raspberry.

The SMB name of the device is TIME-CAPSULE-DE
The share name is TimeCapsule
The device IP is 192.168.1.14

I use « Add network location », not « Windows network (SMB) »
I tried:

  1. smb://TIME-CAPSULE-DE/
  2. smb://TIME-CAPSULE-DE/TimeCapsule
  3. smb://192.168.1.14
  4. smb://192.168.1.14/TimeCapsule

I tried with and without saved user / password

  1. and 3. don’t give any error but just display an empty folder, my share doesn’t appear
  2. and 4. give the error 2 error message.

I’ve been struggling with this for weeks!

In the add network location for the path enter just the ip itself for the server name and nothing else on that line (the smb:// gets added by the protocol option above it) and you will likely have the best luck with using credentials. You may also need to go into settings>services and set the SMB version to min/max v1.

It may also be possible that there is some incorrect credential info that got set along the way that may be causing issues. I would ssh into your device and take a look in ~/.kodi/userdata/passwords.xml. You should see where and how it is adding the credentials to the network path so you can judge if their is an error.

Hello,

Thank you for your help. Unfortunately, it still doesn’t work.
I didn’t type myself “smb://” in front of my IP address, iy has been automatically added by the system, as you explained.
I forced SMB1 protocol in the settings but I still get the same result.
I saw nothing wrong in the passwords.xml file.

I really don’t understand why it doesn’t work although it works perfectly on my other devices.

I have been attempting to get SMB with a Windows 10 PC working for the last 6 hours or so, and I have now finally solved the issue (at least for my setup, but it may help others).

I have:

  1. Vero 4K+ running Kodi 18.9 and OSMC Nov 2020 2020.11-1
  2. Windows PC With Windows 10 - 10.0.19042 Build 19042
  3. A wired/wifi mesh network using static ipv4 addresses served by DHCP.

What worked for me was forcing and constraining the SMB protocol to version to V1, on Kodi, notably including checking the ‘Use Legacy security’.
See Kodi Settings>Services>SMB Client

In windows SMBv1 was not installed so I installed the SMBv1 client and server modules (you probably only need the server module).

Prior to this I did install the smbclient on my Vero4k+ to check the the visibiity of SMB served shares to Kodi ussing the SSH shell. They were all visible for all versions of SMB.
(e.g. osmc@Kodi: smbclient -m smb3 -U -L

Note that on the first succesful attempt at making an SMBv1 conection took sometime, so be patient.

Using the File Manager to setup a new SMB source or simply adding new video/music files works fine.

My Windows setup is straight forward, the folders exposed by SMB are ‘shared’ using the Advanced sharing option with the security group ‘everyone’ given read permission. Obvioulsy you will still need to an account with priviliges to log into when connecting to the SMB server from Kodi.

I know from previous experience that SMB has been flakey for various clients over the last 10 years or so (with devices I have, e.g. Oppo BDP-103) i.e. they would be fine with SMB protocol
until microsoft did an update. So I moved to upnp/dlna using UMS (which I recommend if configured properly), and now I am trying SMB again -

I have not even checked on the performance but I suspect it will probably be OK on my set up, particularly as I have mesh wifi which can cope with reliable Wifi connections up to around 300 Mpbs.

Hope this helps.

Chris

Performance and security wise this is not a recommended solution.

In addition to what fzinken stated you should be aware that Win 10 has an automatic system for purposely removing SMBv1 after a period of time that can’t be turned off forcing you to reinstall it again periodically.

Now that you have some sources setup if you set Kodi’s network settings to min/max SMBv3 do these existing sources continue to work?

Security at the expense of functionality, twas ever thus.

All these attributes of the design & implementation of a system influence each other, i.e. security, flexibility, configurability, functionality - I digress.

Performance wise, I didn’t notice any change when compared with UPNP/DLNA performance and inparticular rendering a 4K UHD ATMOS/TRUEHD movie in an .MKV container.

Agreed SMBv1 is probably less secure than SMBv3, but using SMBv1 (with legacy security setting) was the only way to detect a SMB server on my Win 10 PC.

I tried switching back to SMBv3 since and Kodi was not able to see the SMB Server, or perform a succesful library scan check (I checked the Kodi Log, its full of ‘Unable to open directory’ ERRORS). Similarly I dont see any SMB* server when trying to add a network location in the Kodi file manager, I have to switch back to SMBv1.

During the installation of SMBv1 on Windows 10 there is an option to install or rather NOT install the ‘SMB 1.0/CIFS Automatic Removal’ tool, which as far as I understand, if present, is how SMBv1 may be automatically removed - so, I didn’t install it. See also:

Automatic removal of SMB1 after 15 days is a one-time operation. If an administrator re-installs SMB1, no further attempts will be made to uninstall it.

Given the points above, I think perhaps somebody needs to look at the way Kodi is using the smbclient library, or does the debian distro smbclient library need to be fixed/updated, to be brought uptodate with microsoft SMBv3 ?

(from my Vero4K+ log file - libsmbclient:armhf 2:4.9.5+dfsg-5+deb10u1 - shared library for communication with SMB/CIFS servers).

Chris.

Discovery for SMB only works when using v1. For SMBv3 one can go to videos>files>add videos>browse>add network location> and select SMB, add the ip address (or machine name) of your file source (and nothing else) in the “server name” field and the username and password then click OK. This will give you a new network location that is browsable so all your sources can just be added with videos>files>add videos>browse>[server ip (or machine name)]>

I assumed that when you had connected using SMBv1 there was one or more Kodi sources that you had added and maybe some items that you had scanned into the library. I was asking if, for example, a movie that you added to your library and verified it played using SMBv1 was still working if you switched to SMBv3. The not being able to see the server by just browsing the network when you switch is expected.

Just for context, I personally use an up to date Win10 PC using SMBv3 and other than the lack of network discovery, I have not run into any issues communicating with OSMC.

Thanks for your understanding, but really is should not be necessary to switch between SMBv1 and v3. It should all be possible with just one version.

Chris

It’s not, you can manually enter the network location once and use that as explained previously.

I entered the net loc, with SMBv3, and it has never been effective, including doing via the File Manager (add net loc) and when adding video/music files.

It all works fine with SMBv1.

There’s room for improvement for SMBv3 support - I just hope its addressed.

Thanks for your time. Now I have an HDMI problem … perhaps I shoud post this in the OSMC forum.

If the improvement you seek is the function of being able to browse available smb shares from within Kodi, you will be disappointed to know that it’s Microsoft who removed this ability when they deprecated smb1. Kodi cannot improve this.

Thanks for that.

Nevertheless there is still a compatability issue between Kodi and SMBV3.
I have other devices (e.g. Android phones) which can connect with SMBV3 and see at least the PC Name, with which to authenticate.

In my (user) experience SMBV1 works best with Kodi (18.9), and still requires authentication (if your Win PC is setup properly) so there is some ‘security’.

Kodi/Vero4K should support SMBV3 better, as I’m sure many users use this interface - but then who am I to say what should be improved in Kodi/Vero4K.

Chris.

Thank you thank you thank you! Checking « Use Legacy Security » finally did the trick!!! I had been struggling with this issue for so long!

So now it is working, I can finally watch the movies stored on My Time Capsule from my Raspberry! It was the only device on which it didn’t work… until now!

NB: you can not upgrade to SMB > 1 on a Time Capsule

Glad to be of help.

Chris