I've got Kodi 17 Krypton and would like to start the app automatically when the Raspberry Pi boots.
How can I do this?
Aside from the answers already provided by others, you could also utilise the crontab to do this fairly easily provided that you have already disabled starting Raspbian GUI on startup via
sudo crontab -e
Then add the following line:
@reboot kodi --standalone
Thorough description on my blog post.
If you are running Raspbian 10 (based on Debian Buster), then the proper way to add it is to add
@kodi to the file
~/.config/lxsession/LXDE-pi/autostart which will automatically start it only for your user. If you add it to
/etc/xdg/lxsession/LXDE-pi/autostart then it will affect all users.
The Kodi Wiki suggests that you run the following:
sudo sed -i "1i @kodi" /etc/xdg/lxsession/LXDE-pi/autostart
sed -i "1i @kodi" part simply puts the
@kodi line at the top of the file. Putting it at the top of the file may prevent the desktop from showing up for a brief second. Exiting Kodi will bring you to the desktop in either case.
You can find out which Raspbian version you are running with:
$ cat /etc/issue Raspbian GNU/Linux 10 \n \l
In my case to append "kodi &" at the end of "/etc/rc.local" does not work.
Neither the option of "ENABLED=1" into "/etc/default/kodi", because the file and the startup scripts does not exist.
I have tried to append the following instead that is working for me:
sudo -b -u pi kodi
By the way, if somebody knows how to set up it using a service, and respawn the service when it shut down for any reason, it could be very cool.
I am using raspbian as linux distribution.