Issue accessing shares on domain

I just bought a new Raspberry Pi 3 to install Kodi (or a variant such as OSMC) on to see how it would perform. If all goes well I will replace the 5-7 TV PCs I have throughout my house. I’m new to OSMC but not Kodi.

Here is the skinny…

  1. Currently all my TVs are ran by a Windows 10 PC running Kodi on it.
  2. I have all my Windows 10 Kodi PCs connected to a domain.
  3. They all use the same account to access media (user: HOUSE.local\xmbc and pass: xbmc).
  4. I have an advancedsettings.xml and a mediasources.xml file on each machine that specifics all the paths to things like substitutes, databases, etc.
  5. Since all my kodi PCs were on the domain and used the current logged in account to access media there was no need to specify user/pass on any of the media sources. Now that I’m using a NON Windows OS (such as OSMC’s backend) I need to specify credentials.

=== mediasources.xml ===

<mediasources>
    <network>
        <location id="0">smb://mediaserver/database</location>
    </network>
</mediasources>

=== advancedsettings.xml ===

<advancedsettings>
  <pathsubstitution>
    <substitute>
      <from>special://profile/playlists/</from>
      <to>smb://mediaserver/database/kodi/userdata/playlists/</to>
    </substitute>
    <substitute>
      <from>special://profile/keymaps/</from>
      <to>smb://mediaserver/database/kodi/userdata/keymaps/</to>
    </substitute>
    <substitute>
      <from>special://profile/sources.xml</from>
      <to>smb://mediaserver/database/kodi/userdata/sources.xml</to>
    </substitute>
    <substitute>
      <from>special://profile/mediasources.xml</from>
      <to>smb://mediaserver/database/kodi/userdata/mediasources.xml</to>
    </substitute>
  </pathsubstitution>

  <videodatabase>
    <type>mysql</type>
    <host>mediaserver</host>
    <port>3306</port>
    <user>xbmc</user>
    <pass>xbmc</pass>
    <name>video</name>
  </videodatabase>

  <musicdatabase>
    <type>mysql</type>
    <host>mediaserver</host>
    <port>3306</port>
    <user>xbmc</user>
    <pass>xbmc</pass>
    <name>music</name>
  </musicdatabase>
</advancedsettings>

My Issue:
I have tried things like this…
smb://xbmc:xbmc@mediaserver/database
… but that does not seem to be working.

I know my Pi is connected to the network with no issues because I’m able to see the library (preexisting kodi one that I’m now using with OSMC) and all of it’s glory. I can also view trailers etc. But when it comes to watching anything I have OSMC telling me the file no longer exists and it wants to delete it. So I try to go into FILE MANAGER and add a source… I give it a name and then click browse. Select “Add network location”, choose protocol Windows network (SMB), type in the IP address of the server under server name, type in the user “HOUSE.local\xmbc” and the password “xbmc”, then click browse button. I get “Unknown error 8216”.

Any ideas what I can try to get this things working?
Thanks!

Have you actually created a username and password with the credentials xbmc via Active Directory?

Does it have permissions to access the share?

You have to add the domain to the path:

smb://HOUSE.local;xbmc:xbmc@mediaserver/database

In the future, you can then tweak the login info by editing ~osmc/.kodi/userdata/passwords.xml. You can see it’s just a path substitution.

Yes, I currently have 4 other Kodi boxes using the same info.

Great! This is exactly what I was looking for. Thanks I’ll try it out today.

Ok so here is my new config…

=== sources.xml (located on my mediaserver) ===

<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>tv</name>
            <path pathversion="1">smb://HOUSE.local;xbmc:xbmc@mediaserver/tv/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>movies</name>
            <path pathversion="1">smb://HOUSE.local;xbmc:xbmc@mediaserver/movies/</path>
            <allowsharing>true</allowsharing>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
        <source>
            <name>mp3s</name>
            <path pathversion="1">smb://HOUSE.local;xbmc:xbmc@mediaserver/mp3s/</path>
            <allowsharing>true</allowsharing>
        </source>
    </music>
    <pictures>
        <default pathversion="1"></default>
        <source>
            <name>pictures</name>
            <path pathversion="1">smb://HOUSE.local;xbmc:xbmc@mediaserver/pictures/</path>
            <allowsharing>true</allowsharing>
        </source>
    </pictures>
    <files>
        <default pathversion="1"></default>
        <source>
            <name>kodimaster</name>
            <path pathversion="1">http://kodimaster.com/repo/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>xbmc hub</name>
            <path pathversion="1">http://fusion.xbmchub.com/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>tv files</name>
            <path pathversion="1">smb://HOUSE.local;xbmc:xbmc@mediaserver/tv/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>movie files</name>
            <path pathversion="1">smb://HOUSE.local;xbmc:xbmc@mediaserver/movies/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>fusion</name>
            <path pathversion="1">http://fusion.tvaddons.ag/</path>
            <allowsharing>true</allowsharing>
        </source>
    </files>
</sources>

=== mediasources.xml (located on my mediaserver) ===

<mediasources />

=== advancedsettings.xml (located on my raspberry pi) ===

<advancedsettings>
  <pathsubstitution>
    <substitute>
      <from>special://profile/playlists/</from>
      <to>smb://HOUSE.local;xbmc:xbmc@mediaserver/database/kodi/userdata/playlists/</to>
    </substitute>
    <substitute>
      <from>special://profile/keymaps/</from>
      <to>smb://HOUSE.local;xbmc:xbmc@mediaserver/database/kodi/userdata/keymaps/</to>
    </substitute>
    <substitute>
      <from>special://profile/sources.xml</from>
      <to>smb://HOUSE.local;xbmc:xbmc@mediaserver/database/kodi/userdata/sources.xml</to>
    </substitute>
    <substitute>
      <from>special://profile/mediasources.xml</from>
      <to>smb://HOUSE.local;xbmc:xbmc@mediaserver/database/kodi/userdata/mediasources.xml</to>
    </substitute>
  </pathsubstitution>

  <videodatabase>
    <type>mysql</type>
    <host>mediaserver</host>
    <port>3306</port>
    <user>xbmc</user>
    <pass>xbmc</pass>
    <name>video</name>
  </videodatabase>
</advancedsettings>

OK so I have done a bunch of cleanup and changed some things around based on how I’m assuming Kodi handles the config files, order of loading them etc. I have cleaned out the shared mediasources.xml. I now have a shared sources.xml.

A few quick questions because currently it’s not working as expected…

  1. Should I be putting IP addresses instead of the “mediaserver” host. How can I call that OSMC is resolving the hostname correctly? Should I maybe be using mediaserver.HOUSE.local ?
  2. I just tried to go into the File Manager on OSMC and it seems I have a “movie files” which I’m guessing comes from the section of the sources.xml. Interesting enough I can browse that with no issues! So do you think this might be an issue with the path of all the file locations currently set in the database? In Kodi I used to be able to just hit the “I” key and on the info page it would show the path of the media file it was trying to play. Is there a way to see that in OSMC?

Thanks!

I also (as a test) tried to manually go into the database and change the path of the media file from “smb://mediaserver/movies/My Movie Name/” to “smb://192.168.1.50/movies/My Movie Name/”. Still no joy there. It makes me think this is NOT an issue with DNS but more of an issue with access rights. Is there somewhere else I need to define these credentials for it to use them on all the media it’s trying to access?

Quick question, which OS is your mediaserver? And do you already have Linux machines connecting to the mediaserver?

My mediaserver is running Windows 2008R2. Currently I have 4 Windows 10 PCs running Kodi with no issues. However as far as Linux goes I only have the 1 new Pi setup running OSMC. But the new OSMC Pi can view the folders and files (as well as play movies) when using the file manager. It’s just the existing library that has issues.

Correct me if I’m wrong but at this point playing media from files works but only playing items using the library does not work. I think I’ve had the same issue coming from a database that was filled by Windows, not sure anymore… forgot

Your path in the database is different than mine.
For files from my Windows share a database entry looks like:
‘smb://username:password@CHAMPLAIN/TV Shows/Banshee/’
and a entry to my Linux share looks like:
‘smb://KRYPTON/Kodi/Someplugin/TV Shows/Banshee/’

O wow… I would need to put my user and pass on ALL database entries? That’s crazy… What if I ever changed the password to xbmc in my case? That seems like a very bad design.

I’m going to test it out on one movie just to see if that works though.

The username and password does not become part of the database.
The change to remove anonymous access was added by Microsoft, not OSMC. There are still documented workarounds.

Microsoft’s implementation of SMB, particularly on WS2K8 leaves much to be desired. Use NFS if you are able to do so.

Just to test I tried to make that change in the DB and test it. That did not work either. The crazy thing is though that SMB is SMB… I have it set up the same way in the FILES section on sources and it works like a dream.

Maybe I will try to add a new movie and see how OSMC adds it to the database since I have my new sources set up. Maybe it will add it differently.

At this point I have no clue why OSMC does not like my paths from my existing Kodi database. I wish there was a way to join the OSMC device to my windows domain… Maybe that would solve all the issues with access.

There are several implementations of SMB. WS2K8 leans on the older side, but did receive an update to resolve WannaCry issues.

Look up PBIS (used to be called Likewise Open)
You can join an AD domain and use AD credentials for login. It won’t help however.

For better SMB performance and functionality you should ideally use OS level mounts.

Yes, adding a file through OSMC is probably the best next step. Perhaps the kodi.log will shine some light when you play a file that can not be found.

That SMB stuff is just the interoperability between Windows and Linux, keeps it fun for us. If you were running 2012 or 2016 you probably would have to loosen security on your domain controller :slight_smile:

I’ve had bad experiences with NFS server on Windows, totally messed up permissions or ownership when mixing with Linux and Kodi NFS on Windows but your mileage may vary.

2012 and 2016 are fine and you don’t need to keep a low version of AD when running dcpromo.

NFS on Windows is OK for streaming. NFS booting doesn’t work however due to ACL problems and permission squashing.

OK so I pulled the kodi.log file and started digging into it. At the top I can see where it loads my advancedsettings.xml and gets the correct smb paths (that include my domain, user, pass, and server path) for all the specials like sources.xml, mediasources.xml, RssFeeds.xml, etc. So that looks good. I knew it was grabbing that ok though because the sources were getting read ok. I knew this because when in FileManager browsing via SMB works perfectly with no issues.

So continuing down, I see where it picks up my database info, that loads nicely (I know this because my library loads as expected).

Then… I see the following in the log…

23:11:48.498 T:1926191616 WARNING: VIDEO database configuration is experimental.
23:11:48.499 T:1926191616  NOTICE: Default Video Player: VideoPlayer
23:11:48.499 T:1926191616  NOTICE: Default Audio Player: paplayer
23:11:48.499 T:1926191616  NOTICE: Disabled debug logging due to GUI setting. Level 0.
23:11:48.499 T:1926191616  NOTICE: Log level changed to "LOG_LEVEL_NORMAL"
23:11:48.564 T:1926191616  NOTICE: CMediaSourceSettings: loading media sources from special://masterprofile/sources.xml
23:11:48.581 T:1926191616  NOTICE: Loading player core factory settings from special://xbmc/system/playercorefactory.xml.
23:11:48.585 T:1926191616  NOTICE: Loaded playercorefactory configuration
23:11:48.585 T:1926191616  NOTICE: Loading player core factory settings from special://masterprofile/playercorefactory.xml.
23:11:48.585 T:1926191616  NOTICE: special://masterprofile/playercorefactory.xml does not exist. Skipping.
23:11:48.750 T:1926191616  NOTICE: Running database version Addons27
23:11:49.234 T:1926191616  NOTICE: ADDONS: Using repository repository.xbmc.org
23:11:49.234 T:1926191616  NOTICE: ADDONS: Using repository repository.xbmchub
23:11:49.234 T:1926191616  NOTICE: ADDONS: Using repository repository.sandmann79.plugins
20:01:39.026 T:1926191616  NOTICE: Raspberry PI firmware version: Apr 26 2018 23:18:12 
                                            Copyright (c) 2012 Broadcom
                                            version 90a06d6c6299583cfbf40033bbf895a45920fa71 (clean) (release)
20:01:39.027 T:1926191616  NOTICE: ARM mem: 768MB GPU mem: 256MB MPG2:0 WVC1:0
20:01:39.027 T:1926191616  NOTICE: cache.memorysize: 20MB libass.cache: 0MB

The first thing I noticed there was the following line…
23:11:48.498 T:1926191616 WARNING: VIDEO database configuration is experimental.
What is that all about?

The second thing I noticed…
23:11:48.564 T:1926191616 NOTICE: CMediaSourceSettings: loading media sources from special://masterprofile/sources.xml
And then looking back at what special://masterprofile/ maps to…
23:11:48.178 T:1926191616 NOTICE: special://masterprofile/ is mapped to: /home/osmc/.kodi/userdata

So it looks as if it’s trying to use /home/osmc/.kodi/userdata/sources.xml for my sources after loading my advancedsettings.xml file. When in my mind it should be using mediaserver/database/kodi/userdata/sources.xml. Per the following entry in my advancedsettings.xml…

<substitute>
    <from>special://profile/sources.xml</from>
    <to>smb://HOUSE.local;xbmc:xbmc@mediaserver/database/kodi/userdata/sources.xml</to>
</substitute>

Do I need to add a substitute for special://masterprofile/sources.xml too?

Also… Do you think maybe if I use the passwords.xml that might solve my issue? Because later in the log I get tons of the following types of lines…

20:04:52.678 T:1905259264 WARNING: Process directory 'smb://mediaserver/movies/Atlas Shrugged Part I (2011)/' does not exist - skipping scan.

That is completely normal. I don’t know why after all these years that they still consider the database to be experimental.

You don’t want to do path substitution on the sources.xml. Path substitution is for when the path to media is not the same as what’s in the database.

I use it for managing many kodi installs. If I ever need to change the path to the sources I only need to change it one place.

If I didn’t do it that way, I would have to change 10 kodi configs. But it has always worked like a charm on Windows 10 kodi boxes.

What’s the point of passwords.xml?