Help with pass thru USB settings change on lxc reboot.

megatruckmike

New Member
Sep 5, 2025
7
0
1
I have a container that I configured and have working. However, when I reboot the container it starts up with new permissions. I can not figure out how to keep the permissions I need or force it to start with the right settings.

What I need is: (working setting)

crw-rw---- 1 nut nut 189, 258 Sep 5 13:20 /dev/bus/usb/003/003

With that I can restart the service I need and everything works great.

When I restart the container it starts up like this:

crw-rw---- 1 root root 189, 258 Sep 5 13:16 /dev/bus/usb/003/003


I have tried using the GUI and setting the USB connection in there with device passthru. (currently how I have it working)

I have tried the rules trick on the host.
I have tried mapping gids from the host to the container

I can get the application to work but no matter what I do I can not get the permissions to start the container the way it needs.

Anyone have any suggestions or places to look for other ideas.

Let me know if you need any additional info to troubleshoot.

thanks
Mike
 
Would you mind sharing that rule as well as lsusb, lsusb -vt and pct config CTIDHERE?
 
Last edited:
Would you mind sharing that rule as well as lsusb, lsusb -vt and pct config CTIDHERE?


This was the rule i used.

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="051d", ATTRS{idProduct}=="0002", GROUP="1000", MODE="0660"

also tried it with the actual group name (nut) same results both ways. I did create the group nut on the host as well.
 
Please share all I asked for. I can't really tell from where the command outputs come from. Please include the shell prompt. What does id nut say?
If you want something real simple you could also just use a @reboot crontab and chmod.
 
lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
Bus 002 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 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
Bus 003 Device 002: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lsusb -vt
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
ID 1d6b:0003 Linux Foundation 3.0 root hub
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/15p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 5: Dev 2, If 0, Class=Vendor Specific Class, Driver=usbfs, 12M
ID 10c4:ea60 Silicon Labs CP210x UART Bridge
|__ Port 6: Dev 3, If 0, Class=Human Interface Device, Driver=usbfs, 12M
ID 051d:0002 American Power Conversion Uninterruptible Power Supply
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/8p, 480M
ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/3p, 480M
ID 1d6b:0002 Linux Foundation 2.0 root hub
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
ID 8087:8008 Intel Corp. Integrated Rate Matching Hub

pct config ctidhere
400 Parameter verification failed.
vmid: type check ('integer') failed - got 'ctidhere'
pct config <vmid> [OPTIONS]

the 3rd command failed so not sure what it is looking for. The usb device im working with is:
Bus 003 Device 003: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
 
Host:
id nut
id: ‘nut’: no such user
getent group nut
nut:x:1000:

LCX:
id nut
uid=106(nut) gid=108(nut) groups=108(nut)

getent group nut
nut:x:108:
 
I just tried the @reboot contab and that worked perfect. Probably not the best way to do it. It solved the problem for a simple container.

Thanks a bunch for the idea.