usb passthrough address changes after reboot

HeiligerLahl

New Member
Dec 18, 2022
1
0
1
Hello,

I am trying to pass through my UPS to an LXC container in promox 7.3 and I am stuck with this problem:

After one reboot, the ups shows up on Bus 001 Device 002:
root@SH-proxmox:~# 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 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0a5c:21b4 Broadcom Corp. BCM2070 Bluetooth 2.1 + EDR
Bus 001 Device 002: ID 0001:0000 Fry's Electronics MEC0003
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

After another reboot, the ups may show up on Bus 002 Device 002:
Bus 002 Device 002: ID 0001:0000 Fry's Electronics MEC0003

So, if I pass the device through in the container conf file "115.conf" like this:
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/001/002 dev/bus/usb/001/002 none bind,optional,create=file

Then it works fine for the first reboot, but after the second reboot, the device is not passed through anymore.

I already tried an udev rule for consistent device naming through reboots:
SUBSYSTEM=="usb", ATTR{product}=="MEC0003", ATTR{manufacturer}=="MEC", SYMLINK+="usbGCups"
And I can pass through the created device name /dev/usbGCups correctly to the LXC container.
But NUT (network ups tools) does not recognize /dev/usbGCups: "nut-scanner -U" does not find the usb when passed through as /dev/usbGCups.
Even giving port=/dev/usbGCups in the ups.conf of NUT does not find it.

Anyone an idea?
What else can I try?
 
Last edited:
Hello,

I am trying to pass through my UPS to an LXC container in promox 7.3 and I am stuck with this problem:

After one reboot, the ups shows up on Bus 001 Device 002:
root@SH-proxmox:~# 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 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0a5c:21b4 Broadcom Corp. BCM2070 Bluetooth 2.1 + EDR
Bus 001 Device 002: ID 0001:0000 Fry's Electronics MEC0003
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

After another reboot, the ups may show up on Bus 002 Device 002:
Bus 002 Device 002: ID 0001:0000 Fry's Electronics MEC0003

So, if I pass the device through in the container conf file "115.conf" like this:
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/001/002 dev/bus/usb/001/002 none bind,optional,create=file

Then it works fine for the first reboot, but after the second reboot, the device is not passed through anymore.

I already tried an udev rule for consistent device naming through reboots:
SUBSYSTEM=="usb", ATTR{product}=="MEC0003", ATTR{manufacturer}=="MEC", SYMLINK+="usbGCups"
And I can pass through the created device name /dev/usbGCups correctly to the LXC container.
But NUT (network ups tools) does not recognize /dev/usbGCups: "nut-scanner -U" does not find the usb when passed through as /dev/usbGCups.
Even giving port=/dev/usbGCups in the ups.conf of NUT does not find it.

Anyone an idea?
What else can I try?
Since the Device # is created "randomly" you have to adapt the .conf file before each container start by grep-ing the current device ID from `lsusb` output.
 
With container, you don't usually passthrough the /dev/bus/usb paths but the device node or directory (like /dev/dvb for USB TV tuners) instead. This is also because the drivers and udev rules need to work on the Proxmox host (and won't work inside the container) but it does not really support hotplug.
It's usually easier to use a VM with USB passthrough if you need to pass a device or a specific port, and have the drivers, software and hotplug and unplug work inside the VM. But this does not work well for low-latency or high-bandwidth, for which you need PCIe passthrough of a USB controller.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!