Mailing List Archive

mythbackend in a docker container
Is anybody here running mythbackend in a docker container and
successfully passing through access to PCI and/or USB capture cards?

_______________________________________________
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: mythbackend in a docker container [ In reply to ]
On Sat, Nov 4, 2023, 9:28 AM Paul Gardiner <lists@glidos.net> wrote:

> Is anybody here running mythbackend in a docker container and
> successfully passing through access to PCI and/or USB capture cards?
>

I've only done the backend in a VM using KVM/QEMU Libvirt.

It works great that way with networked tuners. You can also use USB devices.

Jim A

>
Re: mythbackend in a docker container [ In reply to ]
On 04/11/2023 15:31, James Abernathy wrote:
>
>
> On Sat, Nov 4, 2023, 9:28 AM Paul Gardiner <lists@glidos.net
> <mailto:lists@glidos.net>> wrote:
>
> Is anybody here running mythbackend in a docker container and
> successfully passing through access to PCI and/or USB capture cards?
>
>
> I've only done the backend in a VM using KVM/QEMU Libvirt.
>
> It works great that way with networked tuners. You can also use USB devices.

Maybe I should explore KVM as an option. I'm trying to find a more
convenient way to deal with updating my linux distribution when new
versions appear. For ages now, I've been using two servers, one live and
another to install the new version on and test. I know there has to be a
better way. I use OpenSUSE because it's the one I know best, going from
one version of Leap (the name of OpenSUSE's stable releases) to the next
as they come out. They also have a rolling version called Tumbleweed. I
wondered about using that, but my mythtv packages wont build for it at
the moment and, although I may be able to solve that, I worry that it
might be just the first of many problems if I move to the rolling version.

Latest idea was to use the rolling version as a docker host and run
mythbackend in containers still using Leap, which would be very easy to
update in that scenario.

Your post makes me wonder about sticking with Leap versions, and using
KVM just to allow the new version installation to be performed on the
live server while the old version is still running. Then maybe with some
cleverness with grub I can swap to the new version, booting straight
into it without KVM, not needing KVM again until the next update.

I wonder what others do for this, what must be, very common problem. I'm
sure I've been making things unnecessarily difficult for all these years
I've been using two servers.



_______________________________________________
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: mythbackend in a docker container [ In reply to ]
On Sun, Nov 5, 2023 at 10:32?AM Paul Gardiner <lists@glidos.net> wrote:

> On 04/11/2023 15:31, James Abernathy wrote:
> >
> >
> > On Sat, Nov 4, 2023, 9:28 AM Paul Gardiner <lists@glidos.net
> > <mailto:lists@glidos.net>> wrote:
> >
> > Is anybody here running mythbackend in a docker container and
> > successfully passing through access to PCI and/or USB capture cards?
> >
> >
> > I've only done the backend in a VM using KVM/QEMU Libvirt.
> >
> > It works great that way with networked tuners. You can also use USB
> devices.
>
> Maybe I should explore KVM as an option. I'm trying to find a more
> convenient way to deal with updating my linux distribution when new
> versions appear. For ages now, I've been using two servers, one live and
> another to install the new version on and test. I know there has to be a
> better way. I use OpenSUSE because it's the one I know best, going from
> one version of Leap (the name of OpenSUSE's stable releases) to the next
> as they come out. They also have a rolling version called Tumbleweed. I
> wondered about using that, but my mythtv packages wont build for it at
> the moment and, although I may be able to solve that, I worry that it
> might be just the first of many problems if I move to the rolling version.
>
> Latest idea was to use the rolling version as a docker host and run
> mythbackend in containers still using Leap, which would be very easy to
> update in that scenario.
>
> Your post makes me wonder about sticking with Leap versions, and using
> KVM just to allow the new version installation to be performed on the
> live server while the old version is still running. Then maybe with some
> cleverness with grub I can swap to the new version, booting straight
> into it without KVM, not needing KVM again until the next update.
>
> I wonder what others do for this, what must be, very common problem. I'm
> sure I've been making things unnecessarily difficult for all these years
> I've been using two servers.
>

Before I moved my production MythTV backend to V34-Master I had it at v33
with a test PC running v34-master during the development of the new
Webapp. To make that simpler, I started using the test backend on that PC
with KVM.

The problem was my test PC was always being rebuilt with the Disto of the
week. I decided to have another SSD installed with all my media on one
partition and all my KVM stuff on the other partition. So to test a new
Distro without having to rebuild Mythtv I just installed the distro,
installed KVM, and add the VM backend from the KVM partition.

With the setup I could even have multiple VMs each with a different distro
from the host to test different versions of Mythtv and install scripts. I
used both Ubuntu with the mythbuntu ppa on one VM and Debian with build
from packages on another. I even tested Archlinux and mythtv from the AUR
on one VM.

Jim A
Re: mythbackend in a docker container [ In reply to ]
On 05/11/2023 15:30, Paul Gardiner wrote:
> On 04/11/2023 15:31, James Abernathy wrote:
>>
>>
>> On Sat, Nov 4, 2023, 9:28 AM Paul Gardiner <lists@glidos.net <mailto:lists@glidos.net>> wrote:
>>
>>     Is anybody here running mythbackend in a docker container and
>>     successfully passing through access to PCI and/or USB capture cards?
>>
>>
>> I've only done the backend in a VM using KVM/QEMU Libvirt.
>>
>> It works great that way with networked tuners. You can also use USB devices.
>
> Maybe I should explore KVM as an option. I'm trying to find a more convenient way to deal with
> updating my linux distribution when new versions appear. For ages now, I've been using two servers,
> one live and another to install the new version on and test. I know there has to be a better way. I
> use OpenSUSE because it's the one I know best, going from one version of Leap (the name of
> OpenSUSE's stable releases) to the next as they come out. They also have a rolling version called
> Tumbleweed. I wondered about using that, but my mythtv packages wont build for it at the moment and,
> although I may be able to solve that, I worry that it might be just the first of many problems if I
> move to the rolling version.
>
> Latest idea was to use the rolling version as a docker host and run mythbackend in containers still
> using Leap, which would be very easy to update in that scenario.
>
> Your post makes me wonder about sticking with Leap versions, and using KVM just to allow the new
> version installation to be performed on the live server while the old version is still running. Then
> maybe with some cleverness with grub I can swap to the new version, booting straight into it without
> KVM, not needing KVM again until the next update.
>
> I wonder what others do for this, what must be, very common problem. I'm sure I've been making
> things unnecessarily difficult for all these years I've been using two servers.
>
I run an (almost) entirely Debian shop. My principle server is a KVM host and runs a number of VMs.
My general procedure is to keep two copies of our 'main' server as VMs; I also keep two copies of an
http server. One of each is active and the other is either the previous version or the next one,
whenever I have to do a release update. (There are other, smaller VMs which are not paired.)

I can therefore setup and test new versions without disturbing whatever other work is happening.
When I am satisfied there are no more gotchas, I copy across the /home directories from the old to
the new system followed by a final test.

Then, in my router, I have domain names registered in the DNS server portion pointing to whichever
one is currently active. For example, main.example.com -> 192.168.202.17 and so on. All I need to do
is to change the DNS entry and, boom! the new version is in operation.

Snags: as a VM I have separate LVM logical volumes for system and /home, which makes it slightly
easier to adjust volume sizes when required. I do not use copy-on-write (COW) but allocate the whole
disk space required. However, KVM treats logical volumes as /disks/ not /partitions/. This does mean
an awkward use of 'kpartx' to be able to split out the partitions whenever I want to do a copy.
(There are probably easier methods.)

Obviously most of the above has to be done from either the console or an ssh session into the host
server. Once I have a new system disk I can, however, use the hostname to connect to it for testing.
I use thin(nish) clients with x2go for normal work, the only thing that cannot be done via x2go is
mythtv playback. I have, however, used Firefox to access CCTV and they play back fine over that
arrangement.

--

Mike Perkins


_______________________________________________
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: mythbackend in a docker container [ In reply to ]
> On 5 Nov 2023, at 11:30 pm, Paul Gardiner <lists@glidos.net> wrote:
>
> On 04/11/2023 15:31, James Abernathy wrote:
>> On Sat, Nov 4, 2023, 9:28 AM Paul Gardiner <lists@glidos.net <mailto:lists@glidos.net>> wrote:
>> Is anybody here running mythbackend in a docker container and
>> successfully passing through access to PCI and/or USB capture cards?
>> I've only done the backend in a VM using KVM/QEMU Libvirt.
>> It works great that way with networked tuners. You can also use USB devices.
>
> Maybe I should explore KVM as an option. I'm trying to find a more convenient way to deal with updating my linux distribution when new versions appear. For ages now, I've been using two servers, one live and another to install the new version on and test. I know there has to be a better way. I use OpenSUSE because it's the one I know best, going from one version of Leap (the name of OpenSUSE's stable releases) to the next as they come out. They also have a rolling version called Tumbleweed.

Beware! I got bitten thus

I built drivers, needing the kernel stuff, time passed but I had to go back to update a driver that worked with kernel n-2 but not n (v4l API is all over the place)
Eventually I licked wounds, defeated!
Tumbleweed goes not provide previous releases.

Could that relate to mythtv. Like so ..
On tumbleweed n- mythweb worked
On version n it stopped working (python)
Go back to version n-. Yay I’ve got the iso. Unfortuantely zypper won’t play.
No mythweb !!

If you need/want a rolling distro arch looks better (but I’ve not played enough yet)
manjaro or endeverOS may give you a gentler install experience.

The mythtv devs seem to like ubuntu, which I dislike, if you use SuSE then say no more.
But ubuntu experience is works-well, specially if you build packages.


> I wondered about using that, but my mythtv packages wont build for it at the moment and, although I may be able to solve that, I worry that it might be just the first of many problems if I move to the rolling version.
>
> Latest idea was to use the rolling version as a docker host and run mythbackend in containers still using Leap, which would be very easy to update in that scenario.
>
> Your post makes me wonder about sticking with Leap versions, and using KVM just to allow the new version installation to be performed on the live server while the old version is still running. Then maybe with some cleverness with grub I can swap to the new version, booting straight into it without KVM, not needing KVM again until the next update.
>
> I wonder what others do for this, what must be, very common problem. I'm sure I've been making things unnecessarily difficult for all these years I've been using two servers.
>
>
>
> _______________________________________________
> 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

_______________________________________________
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: mythbackend in a docker container [ In reply to ]
On 05/11/2023 16:09, Mike Perkins wrote:
> I run an (almost) entirely Debian shop. My principle server is a KVM
> host and runs a number of VMs. My general procedure is to keep two
> copies of our 'main' server as VMs; I also keep two copies of an http
> server. One of each is active and the other is either the previous
> version or the next one, whenever I have to do a release update. (There
> are other, smaller VMs which are not paired.)
>
> I can therefore setup and test new versions without disturbing whatever
> other work is happening. When I am satisfied there are no more gotchas,
> I copy across the /home directories from the old to the new system
> followed by a final test.
>
> Then, in my router, I have domain names registered in the DNS server
> portion pointing to whichever one is currently active. For example,
> main.example.com -> 192.168.202.17 and so on. All I need to do is to
> change the DNS entry and, boom! the new version is in operation.
>
> Snags: as a VM I have separate LVM logical volumes for system and /home,
> which makes it slightly easier to adjust volume sizes when required. I
> do not use copy-on-write (COW) but allocate the whole disk space
> required. However, KVM treats logical volumes as /disks/ not
> /partitions/. This does mean an awkward use of 'kpartx' to be able to
> split out the partitions whenever I want to do a copy. (There are
> probably easier methods.)
>
> Obviously most of the above has to be done from either the console or an
> ssh session into the host server. Once I have a new system disk I can,
> however, use the hostname to connect to it for testing. I use thin(nish)
> clients with x2go for normal work, the only thing that cannot be done
> via x2go is mythtv playback. I have, however, used Firefox to access
> CCTV and they play back fine over that arrangement.

These discussions have made me realise that I probably don't actually
need to run mythbackend with capture cards under a VM. My testing at the
moment of a freshly installed server is of mythbackend running without
capture cards because the capture cards are in the still running
production server. It's only at the very last stage of the server swap
that I move hardware from one server to the other and make the final
test. It would be a big win for me if I could just perform the install
in a VM, so that I avoid the need for two servers and avoid moving
hardware. Clearly that's possible and, from what you've said, usually
problem free.

Do you know if, with KVM, I can assign a disc to a VM, perform an
install and then update grub so that the machine boots directly into
that disc without KVM involved? I guess it has to be possible - it's
just whether it's easy or hellish.

Paul.


_______________________________________________
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: mythbackend in a docker container [ In reply to ]
On 06/11/2023 02:38, jam wrote:
> Beware! I got bitten thus
>
> I built drivers, needing the kernel stuff, time passed but I had to go back to update a driver that worked with kernel n-2 but not n (v4l API is all over the place)
> Eventually I licked wounds, defeated!
> Tumbleweed goes not provide previous releases.
>
> Could that relate to mythtv. Like so ..
> On tumbleweed n- mythweb worked
> On version n it stopped working (python)
> Go back to version n-. Yay I’ve got the iso. Unfortuantely zypper won’t play.
> No mythweb !!
>
> If you need/want a rolling distro arch looks better (but I’ve not played enough yet)
> manjaro or endeverOS may give you a gentler install experience.
>
> The mythtv devs seem to like ubuntu, which I dislike, if you use SuSE then say no more.
> But ubuntu experience is works-well, specially if you build packages.

Yes, I think I'm probably best avoiding tumbleweed from the sounds of
it, although I've run into v4l driver problems even on Leap. btrfd
snapshots saved me in that case, temporarily reverting part of an update
until a new one appeared.

Paul.
_______________________________________________
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: mythbackend in a docker container [ In reply to ]
On 11/6/23 6:37 AM, Paul Gardiner wrote:
> Do you know if, with KVM, I can assign a disc to a VM, perform an
> install and then update grub so that the machine boots directly into
> that disc without KVM involved? I guess it has to be possible - it's
> just whether it's easy or hellish.


If your question is whether you can configure a KVM VM to start
automatically with the host system, without requiring user interaction,
the answer is yes:
https://www.cyberciti.biz/faq/rhel-centos-linux-kvm-virtualization-start-virtual-machine-guest/

If your question is whether you can run a KVM VM without using KVM,
well, you might need to rephrase your question.


-WD
_______________________________________________
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: mythbackend in a docker container [ In reply to ]
On 06/11/2023 11:37, Paul Gardiner wrote:
>
> Do you know if, with KVM, I can assign a disc to a VM, perform an install and then update grub so
> that the machine boots directly into that disc without KVM involved? I guess it has to be possible -
> it's just whether it's easy or hellish.
>
The problem with that approach is that, when a recognised OS is installed in a guest VM, you usually
get some 'helper' libraries automatically installed with it to make external communication (disks,
HID, USB, video, etc) easier.

Obviously, those won't function if you then take that disk out and reconfigure it with grub to be
stand-alone. The answer, then, would be no.

Or, more accurately, if you plan to do that why bother with a VM at all?

But if you are running your 'old' backend and your 'new' backend as two VMs in the same host, you
could easily move your tuner hardware from one VM to another. Having both running at the same time
could be interesting, though.

Network tuners (eg HDHR) make that task simpler. You just allocate one or more to the new server for
testing then, at cutover, allocate more.

There's nothing to say that you /have/ to run both at once. Just untick the "startup at boot" flag
on the old one when you are done with it and forget it until the next upgrade. It is only taking up
disk space for the OS, after all.

--

Mike Perkins


_______________________________________________
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: mythbackend in a docker container [ In reply to ]
On 06/11/2023 15:53, Mike Perkins wrote:
> On 06/11/2023 11:37, Paul Gardiner wrote:
>>
>> Do you know if, with KVM, I can assign a disc to a VM, perform an
>> install and then update grub so that the machine boots directly into
>> that disc without KVM involved? I guess it has to be possible - it's
>> just whether it's easy or hellish.
>>
> The problem with that approach is that, when a recognised OS is
> installed in a guest VM, you usually get some 'helper' libraries
> automatically installed with it to make external communication (disks,
> HID, USB, video, etc) easier.
>
> Obviously, those won't function if you then take that disk out and
> reconfigure it with grub to be stand-alone. The answer, then, would be no.

Ah yes. I never considered that. So that option is out then.

> Or, more accurately, if you plan to do that why bother with a VM at all?

My (failed) plan was to perform the install of a new version in a VM
hosted on the production server to avoid my current need for two
servers, but avoid the production version running in a VM for the many
months where I have no need for multiple OS instances. Disappointing,
but very useful to know that wont work. I was on the point of wasting
time giving it a try.

> But if you are running your 'old' backend and your 'new' backend as two
> VMs in the same host, you could easily move your tuner hardware from one
> VM to another. Having both running at the same time could be
> interesting, though.
>
> Network tuners (eg HDHR) make that task simpler. You just allocate one
> or more to the new server for testing then, at cutover, allocate more.
>
> There's nothing to say that you /have/ to run both at once. Just untick
> the "startup at boot" flag on the old one when you are done with it and
> forget it until the next upgrade. It is only taking up disk space for
> the OS, after all.

I could go for this option, but I'm not sure that network tuners are an
option for me. I'm recording from satellite with a PCI card and from
terrestrial with a USB device. Both have been working really well so,
even if an alternative is possible, I'm loathed to change.

Cheers,
Paul.
_______________________________________________
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: mythbackend in a docker container [ In reply to ]
On 06/11/2023 15:14, Will Dormann wrote:
> On 11/6/23 6:37 AM, Paul Gardiner wrote:
>> Do you know if, with KVM, I can assign a disc to a VM, perform an
>> install and then update grub so that the machine boots directly into
>> that disc without KVM involved? I guess it has to be possible - it's
>> just whether it's easy or hellish.
>
>
> If your question is whether you can configure a KVM VM to start
> automatically with the host system, without requiring user interaction,
> the answer is yes:
> https://www.cyberciti.biz/faq/rhel-centos-linux-kvm-virtualization-start-virtual-machine-guest/
>
> If your question is whether you can run a KVM VM without using KVM,
> well, you might need to rephrase your question.

Sorry, clear English descriptions are not my strong point, although I
think "without KVM involved" rules out Option 1. It is Option 2 I'm
querying and I think Mike has just ruled it out.
_______________________________________________
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