LXC USB Passthrough

droidus

Member
Apr 5, 2020
107
2
23
34
I am trying to pass through a USB-attached device to my server, through proxmox, to a LXC container. Before doing anything, I did a lsusb, and saw the device, but knew that as is, I probably would not be able to interact with it. I found some instructions on how to proceed from here. Here is what I followed: https://medium.com/@konpat/usb-passthrough-to-an-lxc-proxmox-15482674f11d. When I check to see if the program can contact the usb device, it still is unable to contact it. Is there something else I must do?
 
hi,
once you passthrough the device (like in that post for example), you should be able to see the device in /dev/ or wherever you mounted it (inside the container).

from there you should be able to interact with this device normally.

When I check to see if the program can contact the usb device, it still is unable to contact it.
which program? how do you try this?

just to make sure you can post your pct config CTID output for that container to see if anything is wrong
 
This is the program: https://www.cyberpowersystems.com/product/software/power-panel-personal/powerpanel-for-linux/
systemctl start pwrstatd.service
then
pwrstat -status
which shows:
"The UPS information shows as following:
Current UPS status:
State........................ Lost Communication"

arch: amd64
cores: 2
hostname: cyberpower-panel
memory: 2048
net0: name=eth0,bridge=vmbr0,firewall=1,gw=<ip>,hwaddr=<mac>,ip=<ip>,type=veth
onboot: 1
ostype: ubuntu
rootfs: local-lvm:vm-116-disk-0,size=8G
swap: 1024
unprivileged: 1
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/002/002 dev/bus/usb/002/002 none bind,optional,create=file
 
hiddev doesn't seem to exist in the lxc container.
From the proxmox-side of things, it should be working then?

EDIT: I may have discovered my problem. In the pwrstatd.log file, I see this error message: "
The H2C device can't be used, because the linux system does not support libusb or libusb version is too old."
 
Last edited:
have you asked the vendor about this? is it even supported to work in containers?
 
Years later. I imagine this thread could help someone else. I had a similar issue (same error message) with Proxmox and a Cyberpower unit. What fixed it in my case was to connect the USB cable to the USB 2 port instead of USB 3. I find it’s odd that it was necessary, but without a doubt it fixed the ‘lost communication’ issue and cleared the error "The H2C device can't be used, because the linux system does not support libusb or libusb version is too old."