Autostart Kodi on Vivid

12,442

A more comprehensive guide.

Assumptions:

Starting with a naked Ubuntu Server; only SSH installed. Configuration done via SSH from another machine, not locally.

Install Kodi and pre-reqs:

sudo apt-add-repository ppa:team-xbmc/ppa
sudo apt-get update
sudo apt-get install xinit kodi
sudo apt-get install xserver-xorg-video-intel # If you need the Intel video package)

Create a kodi user & set groups:

sudo adduser --disabled-password --disabled-login --gecos "" kodi
sudo usermod -a -G audio kodi
sudo usermod -a -G video kodi
sudo usermod -a -G input kodi
sudo usermod -a -G dialout kodi
sudo usermod -a -G plugdev kodi
sudo usermod -a -G tty kodi

Reconfigure X11 to allow kodi to use it

dpkg-reconfigure x11-common # Change to Anybody

Create / Edit the Kodi Service

sudo nano /etc/systemd/system/kodi.service

Should look like this: (via @SauliusZ)

[Unit]
Description=Job that runs Kodi
After=default.target graphical.target getty.target sound.target

[Service]
User=kodi
Restart=always
RestartSec=1s
ExecStart=/usr/bin/xinit /usr/bin/kodi --standalone -- -nocursor

[Install]
WantedBy=default.target

Reload and enable the daemon

sudo systemctl daemon-reload
sudo systemctl enable kodi

Test Kodi

sudo service kodi start # should launch Kodi
sudo service kodi stop # should stop Kodi

Reboot to make sure it runs at boot

Share:
12,442

Related videos on Youtube

user262745
Author by

user262745

Updated on September 18, 2022

Comments

  • user262745
    user262745 over 1 year

    Ubuntu Vivid uses systemd, however I don't have a clue how it exactly works. Can maybe someone write the correct kodi.service file what needs to be placed in /etc/systemd/system thanks a lot.

    • ILOVEKODI
      ILOVEKODI almost 8 years
      Are you just using this pc to run kodi? Or other background downloading services, nzbget, couchpotato. So forth?
  • Fran Marzoa
    Fran Marzoa about 6 years
    I did this, it seems quite too the point, and when I do ps aux | grep kodi I can see it there after rebooting, but in the TV there's an Ubuntu desktop login screen instead. :/