Project

General

Profile

TVheadend as LXC or LXD Container

Added by H Hafner about 8 years ago

Hi guys,

just setting up my TV-Fileserver-KNXHomeAutomation-AppX-AppY...AppZ-Server completely new on Ubuntu 16.04 LTS.
To simplify complexity I'd like to use the first time container concept for each app to be more flexible - espec. when reconfiguring system.

So TVheadend should into a LXD Container (as it is Ubuntu default container system).

Has anybody got already experiences with it?

Let me know. I do not have any expriences with containers nor having applications with hardware access running in a container.
So far I see that /dev/dvb/ is not accessible directly from standard LXD containers.

Cheers,


Replies (4)

RE: TVheadend as LXC or LXD Container - Added by Lin Loen about 8 years ago

Hi H,

I´m currently experimenting with TVheadend in LXD on Ubuntu 16.04. However I got a lot of continuity counter errors. Still trying to figure out why.

I used the Ubuntu 16.04 image and installed tvh stable and oscam. Passed through the dvb-s2 adapter(s) and the smargo reader (usb) to the container.

Except for the continuity errors it´s working ok.

Rgds.

RE: TVheadend as LXC or LXD Container - Added by H Hafner about 8 years ago

Hi Lin,

I do not use Oscam. Do you think it might come from it? Continuity errors are related to the mpeg stream...
As I am a bloody beginner with LXD, is the pass-through a difficult thing to do?
Also a network interface needs to be greated to have remote access directly onto TVHeadend on the container, right? Or is it done in a different way?

With all this additonaly configuration (pass-through, networking), does it still means only the container needs to be copied on a different machine?
Or is the convinience of a container then gone??

Thanks.

RE: TVheadend as LXC or LXD Container - Added by Lin Loen about 8 years ago

I used my DD receivers in a standalone server with no problems.
Then I had put the rec´s in my server with TVH in a LXD container and the errors started. After a few days I put them back in the original server, and I still have some errors.
I found some symbol rates were off but that doesn´t count for all the errors.

Networking in LXD is simple. LXD list will list the cont. with its ip.
As for remote access, you could setup a NAT rule with something like:
iptables -t nat -I PREROUTING -i br0 -p tcp --dport 2222 -j DNAT --to 10.205.254.11:22.
This will reroute your serverip;port to LXDcontip:port (eg. servip:2222 to 10.205.254.11:22)

To save NAT rule:

sh -c "iptables-save > /etc/iptables.rules"

Later on, if you delete the container and create a new one, you can either change its ip or change the ip you saved in /etc/iptables.rules.

For pass-through of the receivers I use:

lxc config device add [yourcontainername] /dev/dvb/adapter0/frontend0 unix-char path=/dev/dvb/adapter0/frontend0 && lxc config device add [yourcontainername] /dev/dvb/adapter0/demux0 unix-char path=/dev/dvb/adapter0/demux0 && lxc config device add [yourcontainername] /dev/dvb/adapter0/dvr0 unix-char path=/dev/dvb/adapter0/dvr0 && lxc config device add [yourcontainername] /dev/dvb/adapter0/net0 unix-char path=/dev/dvb/adapter0/net0

Two more commands:

systemctl enable tvheadend

adduser hts root

and TVheadend is running in LXD.

RE: TVheadend as LXC or LXD Container - Added by Anonymous over 7 years ago

I am using docker not LXC/LXD, but maybe the same reason.

Look here (my last answer):
https://tvheadend.org/issues/3810#change-21438

    (1-4/4)