Running tvheadend with Sundtek DVB stick in LXC container
Saturday, 30 July 2022
Just a short reminder to myself, but maybe helpful to others.
- Create a privileged lxc container based on debian-bullseye-amd64
- Create a user for tvheadend on the host, e.g. "lxc-tvheadend"
- Create the directory /srv/tvheadend and chown it to the created user
- Write down the UID and GID of the created user ("id lxc-tvheadend")
- Follow the instructions to install the Sundtek Driver on a Docker host:
https://sundtek.de/wiki/index.php?title=Docker - Provide access to /srv/tvheadend (will be mapped to /srv) and the USB stick within the containers config:
# Sundtek DVB stick
lxc.apparmor.profile = unconfined
lxc.cgroup2.devices.allow = c 212:* rwm
lxc.cgroup2.devices.allow = c 250:* rwm
lxc.cgroup2.devices.allow = c 189:* rwm
lxc.mount.entry = /dev/dvb dev/dvb none bind,optional,create=dir
lxc.mount.entry = /dev/bus/usb dev/bus/usb none bind,optional,create=dir
lxc.mount.entry = /srv/tvheadend srv none bind,optional,create=dir
- Start the container and attach to it
- Within the container, install curl and tvheadend
- Create a new user and group "tvheadend" with the UID/GID of the host system
- Edit /etc/defaults/tvheadend and change the OPTIONS line to
OPTIONS="-u tvheadend -g tvheadend -c /srv/tvheadend" - Install Sundtek driver within the container (not in host mode!)
- Reboot the container