USB devices to LXC, but every reboot/ reconnect new DeviceNr

Bytechanger

Member
Jan 19, 2022
41
1
13
46
Hi,

I want to setup my home automation.
I put on my proxmox an active usb-hub. There are some USB-Dongles.
lsub get the usb-Bus Nr and Device ID.
Set the config to transfer all needed USB-Devices to LXC.

But every reboot of the proxmox or reconnect, connect new device, etc. the Device Number on proxmox changes...
Somtimes it is Bus 001, Device 004, other times Bus 001, Device 074, and so on...

Is there a way to put the Device ID to the LXC ???

Greets

Byte
 
hi,

you can write a udev rule for your device.



get the vendor and product id of your device:
Code:
udevadm info --name=/dev/bus/usb/001/001 --attribute-walk | grep -E 'vendor|product'
    ATTR{idProduct}=="0002"
    ATTR{idVendor}=="1d6b"
    ATTR{product}=="xHCI Host Controller"
    ATTRS{subsystem_vendor}=="0x1b21"
    ATTRS{vendor}=="0x1022"
    ATTRS{subsystem_vendor}=="0x1022"
    ATTRS{vendor}=="0x1022"


then you add a rule file in /etc/udev/rules.d/ directory

Code:
ACTION=="add", ATTRS{idVendor}=="1022", ATTRS{idProduct}=="0002", SYMLINK+="my_cool_usb"

hope this helps!
 

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!