18

I have installed xbmc/kodi on a headless raspbian (no keyboard, no mouse). I thought to configure it with the webserver configuration tools, but I am not able to enable it as I cannot access the GUI: how can enable it via command line?

14

TLDR; I'm working on the same setup; this answer turned into a log of my investigations: see below for a config which works for me.


Background: I've followed the tutorial: Setting up a Raspberry Pi with file sharing and screen sharing for Macs. I've also installed Shairport Sync.

I installed kodi as recommended in the documentation:

sudo apt-get update
sudo apt-get install kodi

Then I can start kodi from the CLI kodi, or from the desktop interface (mirrored on the Mac) under Menu > Sound & Video > Kodi. I have the Pi plugged in to my TV via HDMI, and Kodi shows on the TV, whilst the desktop shows on the Mac.. I haven't found any way of switching apps to Kodi via VNC, or switching spaces (ctrlcmdright arrow shows that that I've only got one space active).

Configuring Kodi via SSH

  • SSH into your server
  • nano /home/pi/.kodi/userdata/guisettings.xml (Forum: Managing Network Settings by SSH)
  • search for the <services> section and edit the following properties, which vary from the default:

.

<services>
    ...
    <airplay>true</airplay>
    ...
    <esallinterfaces>true</esallinterfaces>
    ...
    <upnprenderer>true</upnprenderer>
    <upnpserver>true</upnpserver>
    ...
    <webserver>true</webserver>
    ...
</services>
  • killall -9 kodi.bin
  • start Kodi: kodi
  • see what ports Kodi is listening on netstat -lnptu | grep kodi

.

tcp        0      0 127.0.0.1:9090          0.0.0.0:*               LISTEN      3805/kodi.bin
udp        0      0 0.0.0.0:9777            0.0.0.0:*                           3805/kodi.bin

Potentially helpful tips:

The services documentation lists the default http username:kodi, password:kodi

The logs for kodi can be viewed at:

less ~/.kodi/temp/kodi.log

Fing is a free app on ios and android which will detect devices on the local network, display their MAC addresses, and scan ports. From my iPad, I can see #22:SSH, #548:AFP, #5000:upnp, #5900:VNC, but no :9090 :'(. If I run python -m SimpleHTTPServer on the pi, Fing can see #8000:http-alt.

See if you can hit the configured port from your browser: http://<username>:<password>@<xbmc_ip>:<xbmc_port> (See: iPhone/iPod Touch - no xbmc instances were found)

Further options can be configured by editing (or creating) /home/xbmc/.xbmc/userdata/advancedsettings.xml.

Deleting either of the xml configs will cause them to be recreated with defaults.


Whilst installing Shairport Sync (prior to Kodi), I read:

You should not have more than one zeroconf service on the same system

I've definitely got Avahi running, and kodi uses avahi, too.. Clutching at straws: is there a conflict?

Firing avahi-browse -a returns a list of services all over my network, including:

+   eth0 IPv4 Kodi (pi)                                     _xbmc-jsonrpc._tcp   local
+   eth0 IPv4 Kodi (pi)                                     _xbmc-events._udp    local

Update: I attached a keyboard and went and toggled all the switches which seemed relevant to connectivity. I now connect via http (http://[localIP]:8080). I diffed my updates with the default config, and pasted the relevant lines above.

2

http://kodi.wiki/view/web_interface. This helped instantaneously

  • 1
    Welcome to Raspberry Pi! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Ghanima May 29 '16 at 12:06
  • 'The webserver is disabled by default and has to be manually enabled by the user' - which leads right back to the original question – Craicerjack Mar 24 '18 at 0:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.