title: How can I turn on the Kodi webserver from the command line?
body: <p>My Kodi is running as root (for better or for worse). This means the user folder is:</p>
  
  <pre><code>/root/.kodi/userdata/guisettings.xml
  </code></pre>
  
  <p>A quick search for web-related junk:</p>
  
  <pre><code>cat guisettings.xml  | grep web
  </code></pre>
  
  <p>yields</p>
  
  <pre><code>    &lt;webserver default="true"&gt;false&lt;/webserver&gt;
      &lt;webserverpassword default="true"&gt;&lt;/webserverpassword&gt;
      &lt;webserverport default="true"&gt;8080&lt;/webserverport&gt;
      &lt;webserverusername default="true"&gt;kodi&lt;/webserverusername&gt;
      &lt;webskin default="true"&gt;webinterface.default&lt;/webskin&gt;
  </code></pre>
  
  <p>Looks good to me. I just have to turn on the webserver.</p>
  
  <h1>Steps Taken</h1>
  
  <pre><code>systemctl stop kodi
  perl -i -pe 's/&lt;webserver default="true"&gt;false&lt;\/webserver&gt;/&lt;webserver default="true"&gt;true&lt;\/webserver&gt;/' /root/.kodi/userdata/guisettings.xml # (I actually used vim)
  systemctl start kodi
  </code></pre>
  
  <p>Guess what happens, the <code>guisettings.xml</code> gets overwritten each time I start Kodi. I also tried adding the following file: <code>/root/.kodi/userdata/advancedsettings.xml</code> with the following contents:</p>
  
  <pre><code>&lt;advancedsettings&gt;
      &lt;loglevel hide="attribute"&gt;3&lt;/loglevel&gt;
      &lt;webserver default="true"&gt;true&lt;/webserver&gt;
          &lt;webserverpassword default="true"&gt;&lt;/webserverpassword&gt;
          &lt;webserverport default="true"&gt;8080&lt;/webserverport&gt;
          &lt;webserverusername default="true"&gt;kodi&lt;/webserverusername&gt;
          &lt;webskin default="true"&gt;webinterface.default&lt;/webskin&gt;
  &lt;/advancedsettings&gt;
  </code></pre>
  
  <p>This also does not work.</p>