Mailing List Archive

running mythtv-backend in a VM?
While playing around I have discovered that in some distros it can be
complicated to get mythtv running. So I was wondering if you have a
requirement to run a distro that is not Mythtv friendly. What about using a
VM?

I setup KVM/QEMU and created a VM of Ubuntu 22.04 LTS. I setup a share
directory between the host and Ubuntu guest machine using virtiofs and
mount that via /etc/fstab.

So Installing mythtv on Ubuntu is relatively easy. Since my PC is uses a
network bridge, the VM is on the same subnet as the home network and can
see the HDHR tuners.

This works without any noticeable performance impact on the PC. So to me
keeping Mythtv simple by running it in a Ubuntu VM seems to be a perfect
solution if you are required to run another Distro and want Mythtv?

What am I missing?

Jim A
Re: running mythtv-backend in a VM? [ In reply to ]
On Mon, 8 May 2023 at 20:35, James Abernathy <jfabernathy@gmail.com> wrote:

> While playing around I have discovered that in some distros it can be
> complicated to get mythtv running. So I was wondering if you have a
> requirement to run a distro that is not Mythtv friendly. What about using a
> VM?
>
> I setup KVM/QEMU and created a VM of Ubuntu 22.04 LTS. I setup a share
> directory between the host and Ubuntu guest machine using virtiofs and
> mount that via /etc/fstab.
>
> So Installing mythtv on Ubuntu is relatively easy. Since my PC is uses a
> network bridge, the VM is on the same subnet as the home network and can
> see the HDHR tuners.
>
> This works without any noticeable performance impact on the PC. So to me
> keeping Mythtv simple by running it in a Ubuntu VM seems to be a perfect
> solution if you are required to run another Distro and want Mythtv?
>
> What am I missing?
>
> Jim A
>
>
> _______________________________________________
> 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


For a backend this is perfect if you have networked tuners, e.g. HDHomeRun,
SatIP or other IP based tuners.
I suspect that USB tuners will not work or with very high CPU load and that
PCI/PCIe bus tuners are even more difficult.
The last time I did play with a VM there was also a virtualized graphics
card that was not suitable for video playback by mythfrontend.
So yes, but for backends with network tuners. Of course, I would like to be
proven wrong on this.

Klaas.
Re: running mythtv-backend in a VM? [ In reply to ]
On Mon, May 8, 2023 at 3:06?PM Klaas de Waal <klaas.de.waal@gmail.com>
wrote:

>
>
> On Mon, 8 May 2023 at 20:35, James Abernathy <jfabernathy@gmail.com>
> wrote:
>
>> While playing around I have discovered that in some distros it can be
>> complicated to get mythtv running. So I was wondering if you have a
>> requirement to run a distro that is not Mythtv friendly. What about using a
>> VM?
>>
>> I setup KVM/QEMU and created a VM of Ubuntu 22.04 LTS. I setup a share
>> directory between the host and Ubuntu guest machine using virtiofs and
>> mount that via /etc/fstab.
>>
>> So Installing mythtv on Ubuntu is relatively easy. Since my PC is uses a
>> network bridge, the VM is on the same subnet as the home network and can
>> see the HDHR tuners.
>>
>> This works without any noticeable performance impact on the PC. So to
>> me keeping Mythtv simple by running it in a Ubuntu VM seems to be a perfect
>> solution if you are required to run another Distro and want Mythtv?
>>
>> What am I missing?
>>
>> Jim A
>>
>>
>> _______________________________________________
>> 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
>
>
> For a backend this is perfect if you have networked tuners, e.g.
> HDHomeRun, SatIP or other IP based tuners.
> I suspect that USB tuners will not work or with very high CPU load and
> that PCI/PCIe bus tuners are even more difficult.
> The last time I did play with a VM there was also a virtualized graphics
> card that was not suitable for video playback by mythfrontend.
> So yes, but for backends with network tuners. Of course, I would like to
> be proven wrong on this.
>
> Klaas.
>

In my case the tuners were HDHR networked tuners. The VM video card is not
good enough to run playback, but it is good enough for Program guide stuff
and setting up recordings. However I'm running mythweb on the VM as well
so I can control things from there. I went back and built a VM with just
Ubuntu 22.04 LTS and did all the setup via ssh -X jim@<ip-address>. All I
have remaining to do is figure out how to start the VM on boot of the host.
I know people do it all the time, but I need to research it.

I'm using Kodi with kodi-pvr-mythtv to test it as I have the mythfrontend
on the host already dedicated to another backend. It seems to be a
reasonable solution for someone wanting to run Fedora or Opensuse and not
wanting to mess with the complication of building from source and setting
up mythconverg.

Setting up the backend in a Ubuntu VM is really easy at least for me since
I've done it so much.

Jim A
Re: running mythtv-backend in a VM? [ In reply to ]
On Mon, May 8, 2023 at 6:36?PM James Abernathy <jfabernathy@gmail.com> wrote:

> What am I missing?

Nothing, but, as always, your mileage will vary.

Success will depend on your hardware (and
virtualization solution). If your hardware is
sufficiently capable a VM can perform at
essentially native speed and all devices
(including usb, disk, network, gpu, and ethernet
devices) can be used in dedicated "passthrough"
modes. In the cases of advanced network
and gpu devices with sr-iov support, one can
even share those devices with other VM's
and the host itself at near native capabilities.
For many resources that do not have high
performance or low latency requirements the
thin virtualization layers can work well.
_______________________________________________
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: running mythtv-backend in a VM? [ In reply to ]
On 08/05/2023 21:51, James Abernathy wrote:
>
> In my case the tuners were HDHR networked tuners. The VM video card is not
> good enough to run playback, but it is good enough for Program guide stuff
> and setting up recordings. However I'm running mythweb on the VM as well
> so I can control things from there. I went back and built a VM with just
> Ubuntu 22.04 LTS and did all the setup via ssh -X jim@<ip-address>. All I
> have remaining to do is figure out how to start the VM on boot of the host.
> I know people do it all the time, but I need to research it.
>
To start the VM on boot under KVM there is an option on the Boot Option screen in virt-manager. It
is as simple as clicking that.

I run my main server(s) under a KVM host - everything Debian - and installed virt-manager on it;
adding myself to the appropriate groups (libvirt and libvirt-qemu), which means I can ssh -Y
myuser@host to the host server and just run virt-manager - it comes up on my remote terminal just
fine to do management without having to su or sudo.

Incidentally, if you are using ssh -Y jim@<ip-address>, might I suggest that you change that to
mythtv@<ip-address>? You are supposed to be running both the backend and setup from user 'mythtv'
anyway to avoid permissions issues, so why not just log in directly?

--

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: running mythtv-backend in a VM? [ In reply to ]
On Mon, May 8, 2023 at 5:17?PM Gary Buhrmaster <gary.buhrmaster@gmail.com>
wrote:

> On Mon, May 8, 2023 at 6:36?PM James Abernathy <jfabernathy@gmail.com>
> wrote:
>
> > What am I missing?
>
> Nothing, but, as always, your mileage will vary.
>
> Success will depend on your hardware (and
> virtualization solution). If your hardware is
> sufficiently capable a VM can perform at
> essentially native speed and all devices
> (including usb, disk, network, gpu, and ethernet
> devices) can be used in dedicated "passthrough"
> modes. In the cases of advanced network
> and gpu devices with sr-iov support, one can
> even share those devices with other VM's
> and the host itself at near native capabilities.
> For many resources that do not have high
> performance or low latency requirements the
> thin virtualization layers can work well.
>

In my test case my host was on Linux Mint 21.1 and I'm running KVM/qemu
which has very little overhead. Other than creating a Network bridge on my
Host I didn't do anything unusual for the VM. I did use the virtiofs to
share a host directory for mythtv recording. I can not tell if there are
any problems with such a small 2 tuner backend. But it's a good thing to
know that this is very doable. The next time I have a complicated Distro
installed, I'll try this again, but I don't expect any different issues
since all the distros run KVM/qemu.

Thanks to all for the advice.

Jim A
Re: running mythtv-backend in a VM? [ In reply to ]
On Mon, May 8, 2023 at 6:00?PM Mike Perkins <mikep@randomtraveller.org.uk>
wrote:

>
>
> Incidentally, if you are using ssh -Y jim@<ip-address>, might I suggest
> that you change that to
> mythtv@<ip-address>? You are supposed to be running both the backend and
> setup from user 'mythtv'
> anyway to avoid permissions issues, so why not just log in directly?
>
> --
>
> Mike Perkins
>

I've never tried running as user mythtv only for setup. The Ubuntu install
takes care of that for me. I just have to have the mythtv directories
setup for mythtv:mythtv permissions. I have a systemd service/timer to run
the mythfilldatabase and it runs as mythtv. I also sudo su mythtv to set up
xmltv. So it seems to be fine.

I may just spin up a VM and only use mythtv as the only user and see if
it's easier to deal with.

Jim A
Re: running mythtv-backend in a VM? [ In reply to ]
On Mon, May 8, 2023 at 5:17?PM Gary Buhrmaster <gary.buhrmaster@gmail.com>
wrote:

> On Mon, May 8, 2023 at 6:36?PM James Abernathy <jfabernathy@gmail.com>
> wrote:
>
> > What am I missing?
>
> Nothing, but, as always, your mileage will vary.
>
> Success will depend on your hardware (and
> virtualization solution). If your hardware is
> sufficiently capable a VM can perform at
> essentially native speed and all devices
> (including usb, disk, network, gpu, and ethernet
> devices) can be used in dedicated "passthrough"
> modes. In the cases of advanced network
> and gpu devices with sr-iov support, one can
> even share those devices with other VM's
> and the host itself at near native capabilities.
> For many resources that do not have high
> performance or low latency requirements the
> thin virtualization layers can work well.
>

Sort of planning ahead here. My production backend is using a Hauppauge
WinTV quadTV tuner PCIe card. Not sure if that could be run in a KVM/qemu
VM with the right settings. I guess I'd have to know a lot about the memory
address, I/O, and IRQs.

That system sits in a closet and just runs, so I probably will not change
it until the next LTS comes out.
Re: running mythtv-backend in a VM? [ In reply to ]
>
> While playing around I have discovered that in some distros it can be
> complicated to get mythtv running. So I was wondering if you have a
> requirement to run a distro that is not Mythtv friendly. What about using a
> VM?
>
> I setup KVM/QEMU and created a VM of Ubuntu 22.04 LTS. I setup a share
> directory between the host and Ubuntu guest machine using virtiofs and
> mount that via /etc/fstab.
>
> So Installing mythtv on Ubuntu is relatively easy. Since my PC is uses a
> network bridge, the VM is on the same subnet as the home network and can
> see the HDHR tuners.
>
> This works without any noticeable performance impact on the PC. So to me
> keeping Mythtv simple by running it in a Ubuntu VM seems to be a perfect
> solution if you are required to run another Distro and want Mythtv?
>
> What am I missing?
>

I run a mythbackend VM on Proxmox which is a great virtualisation solution
with a web browser admin UI. HDHR tuners. Works great.
Re: running mythtv-backend in a VM? [ In reply to ]
On Tue, 9 May 2023 at 00:03, Phill Edwards <philledwards@gmail.com> wrote:
>>
>> While playing around I have discovered that in some distros it can be complicated to get mythtv running. So I was wondering if you have a requirement to run a distro that is not Mythtv friendly. What about using a VM?
>>
>> I setup KVM/QEMU and created a VM of Ubuntu 22.04 LTS. I setup a share directory between the host and Ubuntu guest machine using virtiofs and mount that via /etc/fstab.
>>
>> So Installing mythtv on Ubuntu is relatively easy. Since my PC is uses a network bridge, the VM is on the same subnet as the home network and can see the HDHR tuners.
>>
>> This works without any noticeable performance impact on the PC. So to me keeping Mythtv simple by running it in a Ubuntu VM seems to be a perfect solution if you are required to run another Distro and want Mythtv?
>>
>> What am I missing?
>
>
> I run a mythbackend VM on Proxmox which is a great virtualisation solution with a web browser admin UI. HDHR tuners. Works great.
> _______________________________________________
> 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

I too am running mythtv backend on Proxmox (container/lxc) and passing
through a USB TV tuner. It runs very well - containers run with very
little overhead. I can therefore easily do backups, snapshots and try
out upgrades without much hassle - or transfer across to new hardware
easily, which I did last year.
_______________________________________________
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: running mythtv-backend in a VM? [ In reply to ]
On Tue, May 9, 2023 at 3:04?AM Karl Buckland <buckland.karl@gmail.com>
wrote:

> On Tue, 9 May 2023 at 00:03, Phill Edwards <philledwards@gmail.com> wrote:
> >>
> >> While playing around I have discovered that in some distros it can be
> complicated to get mythtv running. So I was wondering if you have a
> requirement to run a distro that is not Mythtv friendly. What about using a
> VM?
> >>
> >> I setup KVM/QEMU and created a VM of Ubuntu 22.04 LTS. I setup a share
> directory between the host and Ubuntu guest machine using virtiofs and
> mount that via /etc/fstab.
> >>
> >> So Installing mythtv on Ubuntu is relatively easy. Since my PC is uses
> a network bridge, the VM is on the same subnet as the home network and can
> see the HDHR tuners.
> >>
> >> This works without any noticeable performance impact on the PC. So to
> me keeping Mythtv simple by running it in a Ubuntu VM seems to be a perfect
> solution if you are required to run another Distro and want Mythtv?
> >>
> >> What am I missing?
> >
> >
> > I run a mythbackend VM on Proxmox which is a great virtualisation
> solution with a web browser admin UI. HDHR tuners. Works great.
>
>
> I too am running mythtv backend on Proxmox (container/lxc) and passing
> through a USB TV tuner. It runs very well - containers run with very
> little overhead. I can therefore easily do backups, snapshots and try
> out upgrades without much hassle - or transfer across to new hardware
> easily, which I did last year.
>
>
Thought I'd summarize what I ended up testing and got working. I learned a
lot about networking and KVM/QEMU.

My big test was putting an Archlinux based Distro called Endeavour OS on
the NUC with 2 SSDs. 1 is the boot drive and is formatted BTRFS; the other
is EXT4 and that is where all the VM images are stored. Something about COW
which BTRFS uses and VMs. I got this working originally with Linux Mint as
host and the VM running Mythtv was Ubuntu 22.04. I was able to import that
VM into my Endeavour OS's KVM with little extra work except setting up the
mythtv storage groups which are all on the host with the VM using them as a
shared directory via virtiofs.

Since my VM images are on the ext4 drive instead of the boot drive I can
save the recordings from the Host and blow away the host and put something
else on without having to do much to get Mythtv back up and working.

My biggest issue was getting the VM to boot when the Host boots. It turns
out that if you don't set up the default network even if you don't use it,
it affects the way the libvirtd service starts up and creates a race
condition between my br0 bridge coming up and libvirtd starting the VMs.
Once that was resolved, it all worked pretty nice.

Jim A
Re: running mythtv-backend in a VM? [ In reply to ]
On Wed, May 10, 2023 at 3:06?PM James Abernathy <jfabernathy@gmail.com>
wrote:

>
>
> On Tue, May 9, 2023 at 3:04?AM Karl Buckland <buckland.karl@gmail.com>
> wrote:
>
>> On Tue, 9 May 2023 at 00:03, Phill Edwards <philledwards@gmail.com>
>> wrote:
>> >>
>> >> While playing around I have discovered that in some distros it can be
>> complicated to get mythtv running. So I was wondering if you have a
>> requirement to run a distro that is not Mythtv friendly. What about using a
>> VM?
>> >>
>> >> I setup KVM/QEMU and created a VM of Ubuntu 22.04 LTS. I setup a share
>> directory between the host and Ubuntu guest machine using virtiofs and
>> mount that via /etc/fstab.
>> >>
>> >> So Installing mythtv on Ubuntu is relatively easy. Since my PC is
>> uses a network bridge, the VM is on the same subnet as the home network and
>> can see the HDHR tuners.
>> >>
>> >> This works without any noticeable performance impact on the PC. So
>> to me keeping Mythtv simple by running it in a Ubuntu VM seems to be a
>> perfect solution if you are required to run another Distro and want Mythtv?
>> >>
>> >> What am I missing?
>> >
>> >
>> > I run a mythbackend VM on Proxmox which is a great virtualisation
>> solution with a web browser admin UI. HDHR tuners. Works great.
>>
>>
>> I too am running mythtv backend on Proxmox (container/lxc) and passing
>> through a USB TV tuner. It runs very well - containers run with very
>> little overhead. I can therefore easily do backups, snapshots and try
>> out upgrades without much hassle - or transfer across to new hardware
>> easily, which I did last year.
>>
>>
> Thought I'd summarize what I ended up testing and got working. I learned
> a lot about networking and KVM/QEMU.
>
> My big test was putting an Archlinux based Distro called Endeavour OS on
> the NUC with 2 SSDs. 1 is the boot drive and is formatted BTRFS; the other
> is EXT4 and that is where all the VM images are stored. Something about COW
> which BTRFS uses and VMs. I got this working originally with Linux Mint as
> host and the VM running Mythtv was Ubuntu 22.04. I was able to import that
> VM into my Endeavour OS's KVM with little extra work except setting up the
> mythtv storage groups which are all on the host with the VM using them as a
> shared directory via virtiofs.
>
> Since my VM images are on the ext4 drive instead of the boot drive I can
> save the recordings from the Host and blow away the host and put something
> else on without having to do much to get Mythtv back up and working.
>
> My biggest issue was getting the VM to boot when the Host boots. It turns
> out that if you don't set up the default network even if you don't use it,
> it affects the way the libvirtd service starts up and creates a race
> condition between my br0 bridge coming up and libvirtd starting the VMs.
> Once that was resolved, it all worked pretty nice.
>
> Jim A
>
>
> _______________________________________________
>
>
+1 for me also, running a vm via KVM, host OS is rocky linux (centos), vm
running myth is ubuntu. I have hdhomerun tuners so it's really pretty
straight forward no cards to pass through etc. I have been running that way
for a looong time also. I do pass a raw disk for all the recordings though.