Feeling real dumb here. I have a Proxmox server with a Ubuntu 22.04 CT running a Plex server, with a Hauppage WinTV-quadHD USB [hauppaugeDOTcom/pages/products/data_quadhd-usb.html] that I’m trying to get Plex to pick up. I’ve got the CT seeing it via lsusb
, however, Plex can’t see it.
From what I’ve read, I need to assign uid/gid’s from the CT to the host, so that the CT can access the mount point of the USB device, however, for whatever reason, I can’t seem to get it through my meter thick skull how tf this is supposed to work. So far I’ve been able to understand what’s happening with containers, but this just isn’t clicking with me.
I’ve followed a few different tutorials/threads, so if things make even less sense in the CT config, that’s why. I’m just throwing stuff in there at this point to see what (if anything) sticks.
lsusb
from inside the CT
plex@plex:~$ lsusb
Bus 003 Device 002: ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 2109:0715 VIA Labs, Inc. VL817 SATA Adaptor
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 005: ID 2040:846d Hauppauge quadHD-A
Bus 002 Device 004: ID 2040:846d Hauppauge quadHD-A
Bus 002 Device 002: ID 04e2:0404 Exar Corp. USB 2.0 Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
id
from inside the CT
plex@plex:~$ id
uid=1000(plex) gid=1000(plex) groups=1000(plex),27(sudo),44(video)
These are my current config files:
Plex CT config
root@server:~# cat /etc/pve/local/lxc/107.conf
arch: amd64
cores: 4
features: nesting=1
hostname: plex
memory: 2048
net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=16:5B:21:19:85:E9,ip=dhcp,ip6=dhcp,type=veth
ostype: ubuntu
rootfs: local-lvm:vm-107-disk-0,size=10G
swap: 512
unprivileged: 1
lxc.cgroup.devices.allow: c 120:* rwm
lxc.cgroup.devices.allow: c 189:* rwm
lxc.cgroup.devices.allow: c 212:* rwm
lxc.cgroup2.devices.allow: c 120:* rwm
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.cgroup2.devices.allow: c 212:* rwm
lxc.mount.entry: /dev/bus/usb/002/ dev/bus/usb/002/ none bind,optional,create=dir
lxc.mount.entry: /dev/dvb dev/dvb none bind,optional,create=dir 0 0
lxc.idmap: u 0 100000 1000
lxc.idmap: g 0 100000 1000
lxc.idmap: u 1000 1000 5
lxc.idmap: g 1000 1000 5
lxc.idmap: u 1000 10000 64535
lxc.idmap: g 1000 10000 64535
lxc.idmap: g 44 44 5
lxc.idmap: g 44 100044 65491
Proxmox /etc/subuid
root@server:~$ cat /etc/subuid
root:100000:65536
root:1000:5
Proxmox /etc/subgid
root@server:~$ cat /etc/subgid
root:100000:65536
root:1000:5
Output from Proxmox when trying to start CT with that config
lxc_map_ids: 3668 newuidmap failed to write mapping "newuidmap: write to uid_map failed: Invalid argument": newuidmap 242615 0 100000 1000 1000 1000 5 1000 101001 64535
lxc_spawn: 1791 Failed to set up id mapping.
__lxc_start: 2074 Failed to spawn container "107"
TASK ERROR: startup for container '107' failed
What I think I’m trying to do:
Create a mount point for the USB devices, in which I’m giving the CT all of /dev/bus/usb/002/
in case the actual devices change ids.
Allow cgroups through with their major numbers (I guess that’s a thing I have to do.).
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.cgroup2.devices.allow: c 212:* rwm
Allow plex (uid/gid 1000)
and video (gid 44)
to have at least 4 mappings (the 4 tuners) from the host. Which apparently corresponds with /dev/dvb/adapter0
through /dev/dvb/adapter3
.
Avoid chown
ing /dev/dvb/
as I want to try other software with the tuner (jellyfin, nextpvr, etc.).
I have a feeling I’m just not getting how the mapping works in /lxc/107.conf
, and how exactly that relates to /etc/subuid
and /etc/subgid
.
Thanks for reading. I’m going to keep reading and trying. Maybe I’ll eventually get it.