kodi

How can I turn on the Kodi webserver from the command line?


My Kodi is running as root (for better or for worse). This means the user folder is:

/root/.kodi/userdata/guisettings.xml

A quick search for web-related junk:

cat guisettings.xml  | grep web

yields

    <webserver default="true">false</webserver>
    <webserverpassword default="true"></webserverpassword>
    <webserverport default="true">8080</webserverport>
    <webserverusername default="true">kodi</webserverusername>
    <webskin default="true">webinterface.default</webskin>

Looks good to me. I just have to turn on the webserver.

Steps Taken

systemctl stop kodi
perl -i -pe 's/<webserver default="true">false<\/webserver>/<webserver default="true">true<\/webserver>/' /root/.kodi/userdata/guisettings.xml # (I actually used vim)
systemctl start kodi

Guess what happens, the guisettings.xml gets overwritten each time I start Kodi. I also tried adding the following file: /root/.kodi/userdata/advancedsettings.xml with the following contents:

<advancedsettings>
    <loglevel hide="attribute">3</loglevel>
    <webserver default="true">true</webserver>
        <webserverpassword default="true"></webserverpassword>
        <webserverport default="true">8080</webserverport>
        <webserverusername default="true">kodi</webserverusername>
        <webskin default="true">webinterface.default</webskin>
</advancedsettings>

This also does not work.


Solution

  • Are you by any chance trying to enable the web server to allow using Kodi remote?

    I encountered the same issue too, "guisettings.xml gets overwritten".

    According to kodi.wiki, you need to configure 2 more XML elements. To be complete, having the following in advancedsettings.xml should help:

    <advancedsettings>
        <services>
            <esallinterfaces>true</esallinterfaces>
            <webserver>true</webserver>
            <zeroconf>true</zeroconf>
        </services>
    </advancedsettings>