Mailing List Archive

Docker with mythtv and hdhomerun
Trying to setup mythtv-backend in a docker container. However, running
into issues trying to get the networking setup correctly with the hdhomerun
tuner card. Anyone got this to work? Basically, i can't seem to get the
bridge working correctly, so my hdhomerun network tuner doesn't work. I
don't know enough about docker's internal networking scheme to figure it
out...


https://github.com/jgoerzen/docker-mythtv

Author noted this:
(pasted from his site above)

Also, if you use a capture device like the HDHomeRun which communicates
back to MythTV via random UDP ports, it can be just about impossible to
make things work with the standard docker port forwarding.

However, there are some workarounds.

You can:

- Use NAT reflection on your firewall to forward packets back in to your
network.
- Bridge your Docker containers to the network
<https://developer.ibm.com/recipes/tutorials/bridge-the-docker-containers-to-external-network/>
- An example: docker network create --driver=bridge --ip-range=
192.168.0.192/29 --subnet=192.168.0.0/24 --aux-address
"DefaultGatewayIPv4=192.168.0.1" -o
"com.docker.network.bridge.name=brlan1"
brlan1
- After that, you can add network=brlan1 --ip=192.168.0.193 do
your docker
run, and you do not need any -pbecause it will be directly accessible
on the new IP.
- Add egress iptables rules to your frontends
- You can set the BackendServerIP and MasterServerIP to the "visible" IP
of the backend (will probably have to do this via mysql). mythbackend will
fail to bind to a visible IP, but a userland redirector like redir may
do the trick.

I tried adding -O BackendServerIP=blah -O MasterServerIP=blah to my
mythfrontend command line. That let it boot, but wasn't sufficient for
streaming.
Re: Docker with mythtv and hdhomerun [ In reply to ]
On Sat, 2017-08-12 at 08:52 -0700, Monkey Pet wrote:
> Also, if you use a capture device like the HDHomeRun which
> communicates back to MythTV via random UDP ports, it can be just
> about impossible to make things work with the standard docker port
> forwarding.

I'd imagine that running with --network=host would be one way to get
around that, at the cost of exposing the host level network within the
container, which has a security implication. See https://docs.docker.co
m/engine/reference/run/#network-host

Ian.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Docker with mythtv and hdhomerun [ In reply to ]
Hoi Monkey,

Saturday, August 12, 2017, 5:52:51 PM, you wrote:

> Trying to setup mythtv-backend in a docker container.  However,
> running into issues trying to get the networking setup correctly
> with the hdhomerun tuner card. Anyone got this to work? Basically, i
> can't seem to get the bridge working correctly, so my hdhomerun
> network tuner doesn't work. I don't know enough about docker's
> internal networking scheme to figure it out...

I don't know about the docker, but can your hdhomerun access dhcp?
Without that it cannot connect. I have my homerun connected on a
dedicated nic and had to setup dhcp on that nic, just for the homerun.


Tot mails,
Hika mailto:hikavdh@gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Docker with mythtv and hdhomerun [ In reply to ]
On 08/12/2017 12:30 PM, Hika van den Hoven wrote:
> Hoi Monkey,
>
> Saturday, August 12, 2017, 5:52:51 PM, you wrote:
>
>> Trying to setup mythtv-backend in a docker container. However,
>> running into issues trying to get the networking setup correctly
>> with the hdhomerun tuner card. Anyone got this to work? Basically, i
>> can't seem to get the bridge working correctly, so my hdhomerun
>> network tuner doesn't work. I don't know enough about docker's
>> internal networking scheme to figure it out...
> I don't know about the docker, but can your hdhomerun access dhcp?
> Without that it cannot connect. I have my homerun connected on a
> dedicated nic and had to setup dhcp on that nic, just for the homerun.

Another option without dhcp. If using NetworkManager:

/etc/NetworkManager/system-connections/eth1

...
[ipv4]
method=link-local
dhcp-send-hostname=false

Or, if using networkd:

$ cat /etc/systemd/network/hdhr.network
[Match]
MACAddress=...0

[Network]
Description=HD Homerun Express Tuner
DHCP=no
LinkLocalAddressing=ipv4

--
Bill
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Docker with mythtv and hdhomerun [ In reply to ]
On 13 August 2017 1:23:09 am Monkey Pet <monkeypet@gmail.com> wrote:

> Trying to setup mythtv-backend in a docker container. However, running
> into issues trying to get the networking setup correctly with the hdhomerun
> tuner card. Anyone got this to work? Basically, i can't seem to get the
> bridge working correctly, so my hdhomerun network tuner doesn't work. I
> don't know enough about docker's internal networking scheme to figure it
> out...
>
>
> https://github.com/jgoerzen/docker-mythtv
>
> Author noted this:
> (pasted from his site above)
>
> Also, if you use a capture device like the HDHomeRun which communicates
> back to MythTV via random UDP ports, it can be just about impossible to
> make things work with the standard docker port forwarding.
>
> However, there are some workarounds.
>
> You can:
>
> - Use NAT reflection on your firewall to forward packets back in to your
> network.
> - Bridge your Docker containers to the network
> <https://developer.ibm.com/recipes/tutorials/bridge-the-docker-containers-to-external-network/>
> - An example: docker network create --driver=bridge --ip-range=
> 192.168.0.192/29 --subnet=192.168.0.0/24 --aux-address
> "DefaultGatewayIPv4=192.168.0.1" -o
> "com.docker.network.bridge.name=brlan1"
> brlan1
> - After that, you can add network=brlan1 --ip=192.168.0.193 do
> your docker
> run, and you do not need any -pbecause it will be directly accessible
> on the new IP.
> - Add egress iptables rules to your frontends
> - You can set the BackendServerIP and MasterServerIP to the "visible" IP
> of the backend (will probably have to do this via mysql). mythbackend will
> fail to bind to a visible IP, but a userland redirector like redir may
> do the trick.
>
> I tried adding -O BackendServerIP=blah -O MasterServerIP=blah to my
> mythfrontend command line. That let it boot, but wasn't sufficient for
> streaming.
>
>
>
> ----------
> _______________________________________________

In my mind a bridge network would be the best place to start. (as others have said be aware of what that means for your network security etc).

How are you starting your container currently?
Re: Docker with mythtv and hdhomerun [ In reply to ]
On Sat, Aug 12, 2017 at 9:06 AM, Ian Campbell <ijc@hellion.org.uk> wrote:

> On Sat, 2017-08-12 at 08:52 -0700, Monkey Pet wrote:
> > Also, if you use a capture device like the HDHomeRun which
> > communicates back to MythTV via random UDP ports, it can be just
> > about impossible to make things work with the standard docker port
> > forwarding.
>
> I'd imagine that running with --network=host would be one way to get
>

Thanks everyone --network=host was what I needed. My server is already
sitting behind a firewall on my LAN and private also, so security isn't an
issue here.

After I did this and backup/restored my db changing the hostname,
everything came up quickly.


> around that, at the cost of exposing the host level network within the
> container, which has a security implication. See https://docs.docker.co
> m/engine/reference/run/#network-host
>
> Ian.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
>