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

1

7

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.

Zecchino answered 4/2, 2018 at 9:8 Comment(0)
B
9

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>
Bidden answered 25/3, 2018 at 9:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.