A Minor Plex Upgrade

Taking advantage of another long weekend, I decided to migrate my media server setup away from the ancient under my TV to a slightly beefier box–the I got earlier in the year, now running .

Changing from an Atom x5-Z8350 to an N5105 pretty much triples average performance, so I can actually throttle it a little and squeeze in more services (I’m thinking of hooking up my LG TV to the directly via its secondary Ethernet interface and set up a firewall to block all its nasty telemetry, for instance).

Rather than using a VM, I am again using an LXC container with Docker inside, so “installing” things was mostly about:

  • Setting up LVM so that could use a secondary SSD to provide /mnt/metadata and /mnt/transcode mountpoints for the Plex container.
  • Adding the CIFS mount points from my to /etc/fstab inside LXC.
  • Using rsync to copy across the docker-compose setup and container configs.
  • Removing apparmor from the Ubuntu container (it’s kind of pointless with a nested setup like this, and it was getting in the way of Docker).
  • Passing /dev/dri to the (privileged) LXC container (and inside that, to the Docker containers that require it).
  • Setting up avahi-daemon and other creature comforts.

I could probably have scripted this, but 90% of the smarts are already in that docker-compose file anyway, and the LVM volume setup is easy enough to do that I won’t bother.

The only catch was that I couldn’t get Intel QuickSync hardware transcoding to work at first–I also set up IOMMU for passing through the iGPU to any “real” VMs in the future, but plain /dev/dri device mapping just wasn’t working, and I was at a loss as to why for several painful hours as Plex (very) slowly indexed my media library.

As it happens, that was because 8 uses cgroup2, so I had to set things up like this:

# cat /etc/pve/lxc/100.conf 
arch: amd64
cores: 4
cpulimit: 1024
cpuunits: 100
features: mount=cifs,nesting=1
hostname: plex
memory: 4096
mp0: scratch:vm-100-disk-0,mp=/mnt/transcode,size=128G
mp1: scratch:vm-100-disk-1,mp=/mnt/metadata,size=32G
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=BC:24:11:XX:XX:XX,ip=dhcp,ip6=dhcp,type=veth
onboot: 1
ostype: ubuntu
rootfs: local-lvm:vm-100-disk-1,size=64G
swap: 2048
lxc.cgroup2.devices.allow: c 226:* rwm
lxc.cgroup2.devices.allow: c 29:* rwm
lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir

Another (minor) glitch is that Handbrake’s QSV support for H.265 encoding currently appears to be broken for the N5105–it’s annoying to have the thing just crash on me (with error 3, in case you’re curious), but H.264 encoding works fine, so I’ll just have to wait for a fix.

Note: one quick way to test if things are working is to run avinfo inside the container and see if it can find the iGPU. Just make sure you have the drivers installed on both the host and the container, and ignore any X-related errors–if there’s no subsequent output, it’s not working.

Plex transcoding “just works”, as usual, and I have for Handbrake if I need them, but it would have been nice to have batch transcoding working, even if it’s a bit slower than my other gear.

Other than that things are really shaping up, and soon I’ll migrate to and add its cohort of LXD-based sandboxes to this:

My growing cluster, minus all the standalone stuff I still have.

And yes, that is a up there. I look forward to a day when we get an official ARM release…

This page is referenced in: