Version 2 vs 9
Version 2 vs 9
Edits
Edits
- Edit by keithzg, Version 9
- Oct 7 2019 5:34 PM
- ·Restructure this page as a landing page
- Edit by keithzg, Version 2
- Sep 15 2019 1:22 AM
- ·Slight rework, and some hope
Edit Older Version 2... | Edit Current Version 9... |
Content Changes
Content Changes
Say you've got something like a Raspberry Pi, and you wanna use it for Kodi.
The official wiki page for this sort of thing is at https://kodi.wiki/view/HOW-TO:HOW-TO:Autostart_Kodi_for_Linux, which points to https://github.com/graysky2/kodi-standalone-service. You could also just use something like OpenELEC (I hate it, personally), but here's some modified takes on the official-ish instructions. This presumes you're running Ubuntu 19.04 on a Pi 3, or have a similar setup to that.
Create `/etc/systemd/system/kodi.service` with the contents as
```
lang=systemd
[Unit]
Description=Kodi standalone (X11)
After=systemd-user-sessions.service network-online.target sound.target mysqld.service
Requires=network-online.target
Conflicts=getty@tty1.service
[Service]
User=kodi
Group=kodi
PAMName=login
TTYPath=/dev/tty1
ExecStart=/usr/bin/xinit /usr/bin/kodi-standalone -- :0 -nolisten tcp vt1
Restart=on-abort
StandardInput=tty
[Install]
WantedBy=graphical.target
```
If ya can't get kodi-gbm to work (which these instructions presume), you'll probably also need to run `apt install xserver-xorg` now.
(One might be able to get GBM to work with `echo "dtoverlay=vc4-fkms-v3d" | sudo tee -a /boot/firmware/config.txt`.)
Then:
```
lang=bash
# Add the group
sudo addgroup kodi
# Add the user, giving it no login shell and with /var/lib/kodi as its home directory
sudo useradd -c 'kodi user' -u 420 -g kodi -G audio,input,uucp,video -d /var/lib/kodi -s /usr/sbin/nologin kodi
# Not sure why this is necessary frankly, since the shell is set to nologin anyways
sudo passwd -l kodi > /dev/null
# Actually make the home directory we're using, and set ownership correctly
sudo mkdir /var/lib/kodi
sudo chown -R kodi:kodi /var/lib/kodi
# Now, enable and start the service
sudo systemctl enable kodi.service
sudo systemctl start kodi.service
```
Say you've got something like a Raspberry Pi, and you wanna use it for Kodi.
There are a few options:
# Use [[ https://libreelec.tv/ | LibreELEC ]]. It's a fast, optimised just-enough OS setup for Kodi, and tends to get the fastest support for hardware acceleration since it's largely the Kodi devs themselves developing it.
## If you want to do more with it, see [[documentation/kodi/standalone/libreelec]] here on this wiki.
# Use a "real" Linux distro like Debian or Ubuntu. See [[documentation/kodi/standalone/debian]] for instructions.
# As an in-between measure, you could use something like [[ https://osmc.tv/ | OSMC ]], which is stripped down and set up for Kodi but is a full Debian-derived distro underneath with `apt` and all that.
Say you've got something like a Raspberry Pi, and you wanna use it for Kodi.
The official wiki page for this sort of thing is at https://kodi.wiki/view/HOW-TO:HOW-TO:Autostart_Kodi_for_Linux, which points to https://github.com/graysky2/kodi-standalone-service. You could also just use something like OpenELEC (I hate it, personally), but here's some modified takes on the official-ish instructions. This presumes you're running Ubuntu 19.04 on a Pi 3, or have a similar setup to that.
Create `/etc/systemd/system/kodi.service` with the contents as
```
lang=systemd
[Unit]
Description=Kodi standalone (X11)
After=systemd-user-sessions.service network-online.target sound.target mysqld.service
Requires=network-online.target
Conflicts=getty@tty1.service
[Service]
User=kodi
Group=kodi
PAMName=login
TTYPath=/dev/tty1
ExecStart=/usr/bin/xinit /usr/bin/kodi-standalone -- :0 -nolisten tcp vt1
Restart=on-abort
StandardInput=tty
[Install]
WantedBy=graphical.target
```
If ya can't get kodi-gbm to work (which these instructions presume), you'll probably also need to run `apt install xserver-xorg` now.
(One might be able to get GBM to work with `echo "dtoverlay=vc4-fkms-v3d" | sudo tee -a /boot/firmware/config.txt`.)
Then:
```
lang=bash
# Add the group
sudo addgroup kodi
# Add the user, giving it no login shell and with /var/lib/kodi as its home directory
sudo useradd -c 'kodi user' -u 420 -g kodi -G audio,input,uucp,video -d /var/lib/kodi -s /usr/sbin/nologin kodi
# Not sure why this is necessary frankly, since the shell is set to nologin anyways
sudo passwd -l kodi > /dev/null
# Actually make the home directory we're using, and set ownership correctly
sudo mkdir /var/lib/kodi
sudo chown -R kodi:kodi /var/lib/kodi
# Now, enable and start the serviceThere are a few options:
sudo systemctl enable kodi.service # Use [[ https://libreelec.tv/ | LibreELEC ]]. It's a fast, optimised just-enough OS setup for Kodi, and tends to get the fastest support for hardware acceleration since it's largely the Kodi devs themselves developing it.
sudo systemctl start ## If you want to do more with it, see [[documentation/kodi.service/standalone/libreelec]] here on this wiki.
``` # Use a "real" Linux distro like Debian or Ubuntu. See [[documentation/kodi/standalone/debian]] for instructions.
# As an in-between measure, you could use something like [[ https://osmc.tv/ | OSMC ]], which is stripped down and set up for Kodi but is a full Debian-derived distro underneath with `apt` and all that.