[Support] Linuxserver.io - Kodi-Headless


Recommended Posts

I just compiled an image file from LibreELEC 8.0 Kyrpton that can be run on a VM without a graphics card if anyone is interested.  We've been working on it over here:

 

@CHBMB, just to verify. after installing the docker, the only thing I should have to do is copy over the advancedsettings.xml and the sources.xml page, and presto?  Or is there something glaringly obvious that I'm missing....

Edited by Living Legend
Link to comment

Went complete nuke on my Kodi setup.  Delete all instances of libraries, sources, etc across all devices.

 

I added libraries from one client.  I went to do an update from the docker:  

 

16:29:32.123 T:47223469459200  NOTICE: VideoInfoScanner: Starting scan ..
16:29:32.123 T:47223465178880   DEBUG: CAnnouncementManager - Announcement: OnScanStarted from xbmc
16:29:34.363 T:47223469459200   DEBUG: VideoInfoScanner: Skipping dir 'smb://192.168.1.3/tv/Cosmos' due to no change
.......
(many more skips due to no change on all tv folder sources)
.......
16:30:36.089 T:47223469459200  NOTICE: VideoInfoScanner: Finished scan. Scanning for video info took 01:03
16:30:36.089 T:47223465178880   DEBUG: CAnnouncementManager - Announcement: OnScanFinished from xbmc

And as before, it never checked the other source, the movies folder.  I triple checked, and on the WEB UI, under browser, it is visible.  The scan however does not scan.

 

Unfortunately, this docker is broke for me at the moment and I will continue to utilize the VM I created until I can figure this one out.

Edited by Living Legend
Link to comment

Question to confirm:

 

1. What kind of kodi version is this? It can be run only via IP address (so some kind of remote) or can i put it straight via HDMI port into TV or so?

2. Tried those Libre/Open Elec versions but they wont work via HDMI on my ASROCK-J4205 ITX system :( just via remote desktop which is useless for media center and 5.1 sound

 

Thanks

Link to comment
9 hours ago, killeriq said:

Question to confirm:

 

1. What kind of kodi version is this? It can be run only via IP address (so some kind of remote) or can i put it straight via HDMI port into TV or so?

2. Tried those Libre/Open Elec versions but they wont work via HDMI on my ASROCK-J4205 ITX system :( just via remote desktop which is useless for media center and 5.1 sound

 

Thanks

 

1. It's stated in the Readme of the git link in the first post. 

2. Headless means that it doesn't have any video or audio output. 

 

This one is used to update a Kodi database and not for viewing. 

Link to comment

Hi  I'm trying to set this up for the first time.  I'm trying to create a fresh library rather than import an existing one (I haven't been using Kodi long so don't have much play history), but I'm struggling.

 

I've edited advancedsettings.xml and created sources.xml in userdata, but nothing seems to be happening in the docker and I keep getting websocket lost messages.  What am I doing wrong?  I couldn't find a step by step guide anywhere - sorry if I've missed it

 

<advancedsettings>

<!-- 
#####################################################
# For more information on the settings available in #
# this file, refer to the kodi wiki at              #
# http://kodi.wiki/view/Advancedsettings.xml        #
#####################################################
-->

<videodatabase>
<type>mysql</type> <!-- don't change this value -->  
<host>172.30.12.2</host> <!-- change this to the IP address of your mysql/mariadb server  -->
<port>3306</port> <!-- change this to the port of your mysql/mariadb server  -->
<user>root</user> <!-- change this to the user for your database, not root  --> 
<pass>xxxxxxxxxxx</pass> <!-- change this to the password for your database -->
</videodatabase>
<musicdatabase>
<type>mysql</type> <!-- don't change this value -->
<host>172.30.12.2</host> <!-- change this to the IP address of your mysql/mariadb server  -->
<port>3306</port> <!-- change this to the port of your mysql/mariadb server  -->
<user>root</user> <!-- change this to the user for your database, not root  -->
<pass>xxxxxxxxxxxxxx</pass> <!-- change this to the password for your database -->
</musicdatabase>

<services>
<devicename>KODI Server</devicename>
<esallinterfaces>true</esallinterfaces> <!-- don't change this value -->
<escontinuousdelay>25</escontinuousdelay>
<esenabled>true</esenabled> <!-- don't change this value -->
<esinitialdelay>750</esinitialdelay>
<esmaxclients>20</esmaxclients>
<esport>9777</esport> <!-- don't change this value -->
<esportrange>10</esportrange>
<upnpannounce>true</upnpannounce>
<upnprenderer>false</upnprenderer>
<upnpserver>true</upnpserver>
<webserver>true</webserver> <!-- don't change this value -->
<webserverpassword>kodi</webserverpassword>
<webserverport>8080</webserverport> <!-- don't change this value -->
<webserverusername>kodi</webserverusername>
<webskin>webinterface.default</webskin>
<zeroconf>true</zeroconf>
</services>


<videolibrary>
<importresumepoint>true</importresumepoint>    <!-- import previously exported resume point from .nfo files -->
<importwatchedstate>true</importwatchedstate>  <!-- import previously exported playdate and playcount from .nfo files -->
<backgroundupdate>true</backgroundupdate>
<dateadded>1</dateadded> <!-- 0 results in using the current datetime when adding a video;
                              1 (default) results in prefering to use the files mtime (if it's valid) and only using the file's ctime if the mtime isn't valid;
                              2 results in using the newer datetime of the file's mtime and ctime -->

</videolibrary>
<musiclibrary>
<backgroundupdate>true</backgroundupdate> <!-- don't change this value -->
</musiclibrary>
<videoscanner>
<ignoreerrors>true</ignoreerrors> <!-- Set to true to silently ignore errors while scanning videos. This prevents the error dialogue box, so you don't have to keep hitting "yes" to keep scanning.-->
</videoscanner>
<splash>false</splash>
<bginfoloadermaxthreads>2</bginfoloadermaxthreads>
<myvideos>
<extractflags>false</extractflags>
<extractthumb>false</extractthumb>
</myvideos>
<lookandfeel>
<enablerssfeeds>false</enablerssfeeds>
</lookandfeel>
<audiooutput>
<guisoundmode>0</guisoundmode>
<ac3passthrough>false</ac3passthrough>
<dtspassthrough>false</dtspassthrough>
<multichannellpcm>false</multichannellpcm>
<truehdpassthrough>false</truehdpassthrough>
<dtshdpassthrough>false</dtshdpassthrough>
<mode>2</mode>
</audiooutput>
<videoscreen>
<vsync>2</vsync>
</videoscreen>
<input>
<enablemouse>false</enablemouse>
<remoteaskeyboard>false</remoteaskeyboard>
</input>
<general>
<addonnotifications>false</addonnotifications>
</general>
<skinsettings>
<setting type="bool" name="skin.confluence.FirstTimeRun">false</setting>
</skinsettings>
</advancedsettings>
<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>DZMM TV Series</name>
            <path pathversion="1">smb://dzmm:xxxxxxxxxxx@172.30.12.2/media/tv shows/library</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>Movies</name>
            <path pathversion="1">smb://dzmm:xxxxxxxxxxx@172.30.12.2/media/movies/library</path>
            <allowsharing>true</allowsharing>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
        <source>
            <name>Music</name>
            <path pathversion="1">smb://dzmm:xxxxxxxxxxx@172.30.12.2/media/music/library</path>
            <allowsharing>true</allowsharing>
        </source>
    </music>
    <pictures>
        <default pathversion="1"></default>
    </pictures>
    <files>
        <default pathversion="1"></default>
    </files>
</sources>

 

Link to comment
  • 3 weeks later...

Hey guys.. read through a lot of the pages in this thread trying to determine what the practical usage is for a headless kodi.  I haven't really been able to determine what it's use is.

 

I understand that it will keep the database updated with changes to the media, right? What's the practical use of that when every kodi-client will still have to do a library update to get the new media listed? Am I missing something here?  

 

I've previously used a shared db via advancedsettings.xml to remember play/watch status, but that didn't change anything about not having to scan for new files on each device.  I guess I can't say for sure whether or not if I scanned on one device if any new files showed up on the second device without scanning --- I imagine that's what is supposed to happen?  And by virtue of the headless scanning for library changes any other device will already be updated?  Does Kodi, when you start it up, scan the remote database for changes automatically?  It's not something I've noticed...

 

Sorry for the newb-ness of the question, it's probably an obvious answer.. 

 

Also I imagine that this would essentially be the same as having kodi running in a windows vm updating the remote database rather than the headless docker?  I've already got a windows vm running for another task, it would be just as easy to run kodi in there rather than this headless thing I'm not too sure about..

 

Thanks for indulging me ;)

Link to comment
15 minutes ago, Energen said:

I haven't really been able to determine what it's use is.

If you don't have a HTPC on 24/7 then running a headless Kodi install as a docker will keep your library (mySQL) up to date.  Point CP/Radarr/Sonarr to the headless to update the library when d/ls are completed

15 minutes ago, Energen said:

What's the practical use of that when every kodi-client will still have to do a library update to get the new media listed? Am I missing something here?  

The best way to set up multiple clients is to have them share a single database (mySQL).  No client will ever have to scan the database.

 

15 minutes ago, Energen said:

Does Kodi, when you start it up, scan the remote database for changes automatically?

Yes

15 minutes ago, Energen said:

I guess I can't say for sure whether or not if I scanned on one device if any new files showed up on the second device without scanning --- I imagine that's what is supposed to happen?

Yes

 

15 minutes ago, Energen said:

Also I imagine that this would essentially be the same as having kodi running in a windows vm updating the remote database rather than the headless docker?  I've already got a windows vm running for another task, it would be just as easy to run kodi in there rather than this headless thing I'm not too sure about..

Yes.  And more flexible at the expense of greater overhead.  In my case, I have one of my servers running a libreelec VM for the HTPC, so since the VM is always on, there's zero point in running a headless kodi docker when the VM can do the exact same thing.

 

15 minutes ago, Energen said:

I've previously used a shared db via advancedsettings.xml to remember play/watch status, but that didn't change anything about not having to scan for new files on each device.

You have to set up all clients to utilize the SQL db

Edited by Squid
Link to comment

I have been using this docker for a while without issue.

 

As of late I am getting the below entry in my sys log.

 

I can't access the WebUi for kodi headless and in the options for the docker the web ui is not listed.

 

Anyone else having this trouble? I have tried latest and krypton branches and also deleted the docker image but still no web ui option and can't access the panel.

 

Any help appreciated.

 

____________

 

May 2 16:45:43 Tower kernel: docker0: port 1(vethee14e6e) entered disabled state
May 2 16:45:43 Tower kernel: device vethee14e6e left promiscuous mode

 

____________

Link to comment

I'm having another go at setting up this docker, but I'm struggling as I can't find an E-2-E guide.  I think I'm messing up the mariadb settings.  I've entered a password in the docker settings, but how do I create a new non-root user and does that new user have the password setup in the docker?

 

Thanks

Link to comment
1 hour ago, DZMM said:

I'm having another go at setting up this docker, but I'm struggling as I can't find an E-2-E guide.  I think I'm messing up the mariadb settings.  I've entered a password in the docker settings, but how do I create a new non-root user and does that new user have the password setup in the docker?

 

Thanks

Easiest way would be to install MySQL workbench on your desktop, point it at the IP of your server (port 3306), and enter in the commands that are listed on Kodi's website:

  1. Type in: CREATE USER 'kodi' IDENTIFIED BY 'kodi'; and press return
  2. Type in: GRANT ALL ON *.* TO 'kodi'; and press return

Link to comment

Still no joy.  It's just whirring around saying 'Just a sec' with occassional messages popping up saying 'Attempting websocket reconnect' and then 'lost websocket connection'.

 

Here's what I've done so far.

 

1. Installed Kodi Docker

2. Installed MariaDB

3. Ran the commands you listed above

4. Copied my sources.xml over to the userdata folder

<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>tv shows</name>
            <path pathversion="1">smb://HIGHLANDER/media/tv shows/adults/</path>
            <path pathversion="1">smb://HIGHLANDER/media/tv shows/kids/</path>
            <allowsharing>true</allowsharing>
        </source>
        <source>
            <name>movies</name>
            <path pathversion="1">smb://HIGHLANDER/media/movies/library/adults/</path>
            <path pathversion="1">smb://HIGHLANDER/media/movies/library/kids/</path>
            <allowsharing>true</allowsharing>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
        <source>
            <name>music</name>
            <path pathversion="1">smb://HIGHLANDER/media/music/library/adults/</path>
            <allowsharing>true</allowsharing>
        </source>
    </music>
    <pictures>
        <default pathversion="1"></default>
    </pictures>
    <files>
        <default pathversion="1"></default>
    </files>
</sources>

5. Filled in advancedsettings.xml

<advancedsettings>

<!-- 
#####################################################
# For more information on the settings available in #
# this file, refer to the kodi wiki at              #
# http://kodi.wiki/view/Advancedsettings.xml        #
#####################################################
-->

<videodatabase>
<type>mysql</type> <!-- don't change this value -->  
<host>172.30.12.2</host> <!-- change this to the IP address of your mysql/mariadb server  -->
<port>3306</port> <!-- change this to the port of your mysql/mariadb server  -->
<user>kodi</user> <!-- change this to the user for your database, not root  --> 
<pass>PASSWORD</pass> <!-- change this to the password for your database -->
</videodatabase>
<musicdatabase>
<type>mysql</type> <!-- don't change this value -->
<host>172.30.12.2</host> <!-- change this to the IP address of your mysql/mariadb server  -->
<port>3306</port> <!-- change this to the port of your mysql/mariadb server  -->
<user>kodi</user> <!-- change this to the user for your database, not root  -->
<pass>PASSWORD</pass> <!-- change this to the password for your database -->
</musicdatabase>

<services>
<devicename>KODI Server</devicename>
<esallinterfaces>true</esallinterfaces> <!-- don't change this value -->
<escontinuousdelay>25</escontinuousdelay>
<esenabled>true</esenabled> <!-- don't change this value -->
<esinitialdelay>750</esinitialdelay>
<esmaxclients>20</esmaxclients>
<esport>9777</esport> <!-- don't change this value -->
<esportrange>10</esportrange>
<upnpannounce>true</upnpannounce>
<upnprenderer>false</upnprenderer>
<upnpserver>true</upnpserver>
<webserver>true</webserver> <!-- don't change this value -->
<webserverpassword>kodi</webserverpassword>
<webserverport>8080</webserverport> <!-- don't change this value -->
<webserverusername>kodi</webserverusername>
<webskin>webinterface.default</webskin>
<zeroconf>true</zeroconf>
</services>


<videolibrary>
<importresumepoint>true</importresumepoint>    <!-- import previously exported resume point from .nfo files -->
<importwatchedstate>true</importwatchedstate>  <!-- import previously exported playdate and playcount from .nfo files -->
<backgroundupdate>true</backgroundupdate>
<dateadded>1</dateadded> <!-- 0 results in using the current datetime when adding a video;
                              1 (default) results in prefering to use the files mtime (if it's valid) and only using the file's ctime if the mtime isn't valid;
                              2 results in using the newer datetime of the file's mtime and ctime -->

</videolibrary>
<musiclibrary>
<backgroundupdate>true</backgroundupdate> <!-- don't change this value -->
</musiclibrary>
<videoscanner>
<ignoreerrors>true</ignoreerrors> <!-- Set to true to silently ignore errors while scanning videos. This prevents the error dialogue box, so you don't have to keep hitting "yes" to keep scanning.-->
</videoscanner>
<splash>false</splash>
<bginfoloadermaxthreads>2</bginfoloadermaxthreads>
<myvideos>
<extractflags>false</extractflags>
<extractthumb>false</extractthumb>
</myvideos>
<lookandfeel>
<enablerssfeeds>false</enablerssfeeds>
</lookandfeel>
<audiooutput>
<guisoundmode>0</guisoundmode>
<ac3passthrough>false</ac3passthrough>
<dtspassthrough>false</dtspassthrough>
<multichannellpcm>false</multichannellpcm>
<truehdpassthrough>false</truehdpassthrough>
<dtshdpassthrough>false</dtshdpassthrough>
<mode>2</mode>
</audiooutput>
<videoscreen>
<vsync>2</vsync>
</videoscreen>
<input>
<enablemouse>false</enablemouse>
<remoteaskeyboard>false</remoteaskeyboard>
</input>
<general>
<addonnotifications>false</addonnotifications>
</general>
<skinsettings>
<setting type="bool" name="skin.confluence.FirstTimeRun">false</setting>
</skinsettings>
</advancedsettings>

 

Link to comment
1 minute ago, Squid said:

That's the IP of the docker... Use the IP of your server

I think this is where I'm getting confused.  I've got Kodi-Headless running on my unraid machine which has an IP of 172.30.12.2 - should I be be putting in the IP of one of my kodi clients e.g. my mi box 3 which has an IP of 172.30.12.10???? 

Link to comment
3 minutes ago, DZMM said:

I think this is where I'm getting confused.  I've got Kodi-Headless running on my unraid machine which has an IP of 172.30.12.2 - should I be be putting in the IP of one of my kodi clients e.g. my mi box 3 which has an IP of 172.30.12.10???? 

You use the IP address of your server.  Or where ever MariaDB is running.  But when you created the Kodi user on mariadb, if you didn't create a password (and the commands as listed do not create a user -> and Kodi suggests to not create passwords due to the complexities), then you have to remove the password entry from AdvancedSettings.xml

Link to comment

Also, if you used workbench to run those commands, then if you didn't hit the lightning bolt or something to actually run them, then they were never executed.  You should see a result of something akin to

 

blah blah blah 0 rows affected

Link to comment
1 hour ago, Squid said:

Also, if you used workbench to run those commands, then if you didn't hit the lightning bolt or something to actually run them, then they were never executed.  You should see a result of something akin to

 

blah blah blah 0 rows affected

yep, that's what I saw.  Still no joy.  Latest attempt:

- removed mariadb and reinstalled with no password - made no other changes to mariadb

- removed password from advancedsettings.xml (also tried with password kodi just in case)

 

Still getting websockets messages popping up and no media in kodi headless.

Link to comment
yep, that's what I saw.  Still no joy.  Latest attempt:
- removed mariadb and reinstalled with no password - made no other changes to mariadb
- removed password from advancedsettings.xml (also tried with password kodi just in case)
 
Still getting websockets messages popping up and no media in kodi headless.

Question first. So your clients already use sql? If not set one of them up first to do that and from it scan the media. Much simpler to see if anything works in the first place

Sent from my LG-D852 using Tapatalk

Link to comment
16 minutes ago, Squid said:


Question first. So your clients already use sql? If not set one of them up first to do that and from it scan the media. Much simpler to see if anything works in the first place

Sent from my LG-D852 using Tapatalk
 

ok, tried setting up a client following the instructions on the kodi site with the advancedsettings.xml they have:

 

<advancedsettings>
  <videodatabase>
    <type>mysql</type>
    <host>172.30.12.2</host>
    <port>3306</port>
    <user>kodi</user>
    <pass></pass>
  </videodatabase> 
  <musicdatabase>
    <type>mysql</type>
    <host>172.30.12.2</host>
    <port>3306</port>
    <user>kodi</user>
    <pass>/pass>
  </musicdatabase>
  <videolibrary>
    <importwatchedstate>true</importwatchedstate>
    <importresumepoint>true</importresumepoint>
  </videolibrary>
</advancedsettings>

Tried with and without password kodi inserted and no joy with files added to library. 

 

Giving up - thanks for trying anyway

Link to comment
21 hours ago, CHBMB said:

Try scanning to populate the database from a client.  Then checking on another client.

Thanks.  I focussed today on just getting mysql working by installing a kodi client going on my daily driver VM - figured this is as good as the headless version as my VM is on 24/7.  

 

I think my problems yesterday were with setting up the kodi database user.  Using MySQL workbench was easy to do this (thanks for the advice Squid) as I just clicked on 'Users and privilidges' , added a new user account 'kodi/kodi', then clicked on 'Administrative Roles' and ticked the 'DBA' box to give that user full privilidges.

 

My VM kodi installation is now populating the library.  I think I jumped the gun earlier and added the mysql settings to one of my TV clients, but it seemed to crash the whole process, so I've started again and waiting until the VM has finished before adding more clients.  I am a little bit worried though that it seemed a bit flaky with concurrent usage....we will see.

 

I might still try and setup the headless client, as it'd be nice to have everything dockerised.

Link to comment
3 minutes ago, CHBMB said:

I've been using a centralised MySQL database for years now and always been rock solid.

Good to know.  I think I'll still wait until the full initial build has been done before adding other clients.

Link to comment
  • 4 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.