Login to raspbery pi with ssh(putty,xshell)
1.It’s always a good idea to upgrade the distribution and the Raspberry Pi 2 to the latest versions:$sudo apt-get upgrade --yes $sudo rpi-update
$sudo reboot now
2.Installing kodi
$sudo apt-get install kodi --yesAutostarting Kodi on boot
3.$sudo nano /etc/default/kodi
and change the 0 to 1:
# Set this to 1 to enable startup ENABLED=0
# The user to run Kodi as default to pi
USER=pi