[SOLVED] Cannot get USB passthrough to LXC to work

Buckeyes1995

New Member
Jan 14, 2023
15
0
1
Good morning,

I am trying to pass my Aeotec Z-Stick Gen 5 to my LXC container. The container is unprivileged. Note that I do NOT see a /dev/ttyACM0 device (or similar).

Running 'lsusb' I get:

Code:
root@proxmox:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0658:0200 Sigma Designs, Inc. Aeotec Z-Stick Gen5 (ZW090) - UZB
Bus 001 Device 003: ID 05ac:8242 Apple, Inc. Built-in IR Receiver
Bus 001 Device 007: ID 05ac:8289 Apple, Inc. Bluetooth Host Controller
Bus 001 Device 002: ID 0a5c:4500 Broadcom Corp. BCM2046B1 USB 2.0 Hub (part of BCM2046 Bluetooth)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I verified the IDs:

Code:
root@proxmox:~# ls -l /dev/bus/usb/001/005
crw-rw-r-- 1 root root 189, 4 Jan 13 16:21 /dev/bus/usb/001/005

I then edited my 103.conf file to add the following:

Code:
lxc.cgroup.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/001/005 dev/bus/usb/001/005 none bind,optional,create=file

Still no luck. Am I missing a step?

Thanks.
 
You have written, that you don't see a /dev/ttyACM0 device in the proxmox, right?
If you can't get the linux, where proxmox is running, to correctly bind the usb stick a transfer to a lxc will not work.

So just to make shure we are on the same side of seeing everything:
you did
Code:
ls -l /dev/tty*
on your proxmox machine?
The output should look like this:
Code:
root@pve:~# ls -l /dev/tty*
crw-rw-rw- 1 root tty       5,  0 Jan 18 11:06 /dev/tty
crw--w---- 1 root tty       4,  0 Jan  3 20:56 /dev/tty0
crw--w---- 1 root tty       4,  1 Jan  3 20:56 /dev/tty1
crw--w---- 1 root tty       4, 10 Jan  3 20:56 /dev/tty10
crw--w---- 1 root tty       4, 11 Jan  3 20:56 /dev/tty11
crw--w---- 1 root tty       4, 12 Jan  3 20:56 /dev/tty12
crw--w---- 1 root tty       4, 13 Jan  3 20:56 /dev/tty13
crw--w---- 1 root tty       4, 14 Jan  3 20:56 /dev/tty14
crw--w---- 1 root tty       4, 15 Jan  3 20:56 /dev/tty15
crw--w---- 1 root tty       4, 16 Jan  3 20:56 /dev/tty16
crw--w---- 1 root tty       4, 17 Jan  3 20:56 /dev/tty17
crw--w---- 1 root tty       4, 18 Jan  3 20:56 /dev/tty18
crw--w---- 1 root tty       4, 19 Jan  3 20:56 /dev/tty19
crw--w---- 1 root tty       4,  2 Jan  3 20:56 /dev/tty2
crw--w---- 1 root tty       4, 20 Jan  3 20:56 /dev/tty20
crw--w---- 1 root tty       4, 21 Jan  3 20:56 /dev/tty21
crw--w---- 1 root tty       4, 22 Jan  3 20:56 /dev/tty22
crw--w---- 1 root tty       4, 23 Jan  3 20:56 /dev/tty23
crw--w---- 1 root tty       4, 24 Jan  3 20:56 /dev/tty24
crw--w---- 1 root tty       4, 25 Jan  3 20:56 /dev/tty25
crw--w---- 1 root tty       4, 26 Jan  3 20:56 /dev/tty26
crw--w---- 1 root tty       4, 27 Jan  3 20:56 /dev/tty27
crw--w---- 1 root tty       4, 28 Jan  3 20:56 /dev/tty28
crw--w---- 1 root tty       4, 29 Jan  3 20:56 /dev/tty29
crw--w---- 1 root tty       4,  3 Jan  3 20:56 /dev/tty3
crw--w---- 1 root tty       4, 30 Jan  3 20:56 /dev/tty30
crw--w---- 1 root tty       4, 31 Jan  3 20:56 /dev/tty31
crw--w---- 1 root tty       4, 32 Jan  3 20:56 /dev/tty32
crw--w---- 1 root tty       4, 33 Jan  3 20:56 /dev/tty33
crw--w---- 1 root tty       4, 34 Jan  3 20:56 /dev/tty34
crw--w---- 1 root tty       4, 35 Jan  3 20:56 /dev/tty35
crw--w---- 1 root tty       4, 36 Jan  3 20:56 /dev/tty36
crw--w---- 1 root tty       4, 37 Jan  3 20:56 /dev/tty37
crw--w---- 1 root tty       4, 38 Jan  3 20:56 /dev/tty38
crw--w---- 1 root tty       4, 39 Jan  3 20:56 /dev/tty39
crw--w---- 1 root tty       4,  4 Jan  3 20:56 /dev/tty4
crw--w---- 1 root tty       4, 40 Jan  3 20:56 /dev/tty40
crw--w---- 1 root tty       4, 41 Jan  3 20:56 /dev/tty41
crw--w---- 1 root tty       4, 42 Jan  3 20:56 /dev/tty42
crw--w---- 1 root tty       4, 43 Jan  3 20:56 /dev/tty43
crw--w---- 1 root tty       4, 44 Jan  3 20:56 /dev/tty44
crw--w---- 1 root tty       4, 45 Jan  3 20:56 /dev/tty45
crw--w---- 1 root tty       4, 46 Jan  3 20:56 /dev/tty46
crw--w---- 1 root tty       4, 47 Jan  3 20:56 /dev/tty47
crw--w---- 1 root tty       4, 48 Jan  3 20:56 /dev/tty48
crw--w---- 1 root tty       4, 49 Jan  3 20:56 /dev/tty49
crw--w---- 1 root tty       4,  5 Jan  3 20:56 /dev/tty5
crw--w---- 1 root tty       4, 50 Jan  3 20:56 /dev/tty50
crw--w---- 1 root tty       4, 51 Jan  3 20:56 /dev/tty51
crw--w---- 1 root tty       4, 52 Jan  3 20:56 /dev/tty52
crw--w---- 1 root tty       4, 53 Jan  3 20:56 /dev/tty53
crw--w---- 1 root tty       4, 54 Jan  3 20:56 /dev/tty54
crw--w---- 1 root tty       4, 55 Jan  3 20:56 /dev/tty55
crw--w---- 1 root tty       4, 56 Jan  3 20:56 /dev/tty56
crw--w---- 1 root tty       4, 57 Jan  3 20:56 /dev/tty57
crw--w---- 1 root tty       4, 58 Jan  3 20:56 /dev/tty58
crw--w---- 1 root tty       4, 59 Jan  3 20:56 /dev/tty59
crw--w---- 1 root tty       4,  6 Jan  3 20:56 /dev/tty6
crw--w---- 1 root tty       4, 60 Jan  3 20:56 /dev/tty60
crw--w---- 1 root tty       4, 61 Jan  3 20:56 /dev/tty61
crw--w---- 1 root tty       4, 62 Jan  3 20:56 /dev/tty62
crw--w---- 1 root tty       4, 63 Jan  3 20:56 /dev/tty63
crw--w---- 1 root tty       4,  7 Jan  3 20:56 /dev/tty7
crw--w---- 1 root tty       4,  8 Jan  3 20:56 /dev/tty8
crw--w---- 1 root tty       4,  9 Jan  3 20:56 /dev/tty9
crw-rw-rw- 1 root dialout 166,  0 Jan 19 10:21 /dev/ttyACM0
crw------- 1 root root      5,  3 Jan  3 20:56 /dev/ttyprintk
crw-rw---- 1 root dialout   4, 64 Jan  3 20:56 /dev/ttyS0
crw-rw---- 1 root dialout   4, 65 Jan  3 20:56 /dev/ttyS1
crw-rw---- 1 root dialout   4, 74 Jan  3 20:56 /dev/ttyS10
crw-rw---- 1 root dialout   4, 75 Jan  3 20:56 /dev/ttyS11
crw-rw---- 1 root dialout   4, 76 Jan  3 20:56 /dev/ttyS12
crw-rw---- 1 root dialout   4, 77 Jan  3 20:56 /dev/ttyS13
crw-rw---- 1 root dialout   4, 78 Jan  3 20:56 /dev/ttyS14
crw-rw---- 1 root dialout   4, 79 Jan  3 20:56 /dev/ttyS15
crw-rw---- 1 root dialout   4, 80 Jan  3 20:56 /dev/ttyS16
crw-rw---- 1 root dialout   4, 81 Jan  3 20:56 /dev/ttyS17
crw-rw---- 1 root dialout   4, 82 Jan  3 20:56 /dev/ttyS18
crw-rw---- 1 root dialout   4, 83 Jan  3 20:56 /dev/ttyS19
crw-rw---- 1 root dialout   4, 66 Jan  3 20:56 /dev/ttyS2
crw-rw---- 1 root dialout   4, 84 Jan  3 20:56 /dev/ttyS20
crw-rw---- 1 root dialout   4, 85 Jan  3 20:56 /dev/ttyS21
crw-rw---- 1 root dialout   4, 86 Jan  3 20:56 /dev/ttyS22
crw-rw---- 1 root dialout   4, 87 Jan  3 20:56 /dev/ttyS23
crw-rw---- 1 root dialout   4, 88 Jan  3 20:56 /dev/ttyS24
crw-rw---- 1 root dialout   4, 89 Jan  3 20:56 /dev/ttyS25
crw-rw---- 1 root dialout   4, 90 Jan  3 20:56 /dev/ttyS26
crw-rw---- 1 root dialout   4, 91 Jan  3 20:56 /dev/ttyS27
crw-rw---- 1 root dialout   4, 92 Jan  3 20:56 /dev/ttyS28
crw-rw---- 1 root dialout   4, 93 Jan  3 20:56 /dev/ttyS29
crw-rw---- 1 root dialout   4, 67 Jan  3 20:56 /dev/ttyS3
crw-rw---- 1 root dialout   4, 94 Jan  3 20:56 /dev/ttyS30
crw-rw---- 1 root dialout   4, 95 Jan  3 20:56 /dev/ttyS31
crw-rw---- 1 root dialout   4, 68 Jan  3 20:56 /dev/ttyS4
crw-rw---- 1 root dialout   4, 69 Jan  3 20:56 /dev/ttyS5
crw-rw---- 1 root dialout   4, 70 Jan  3 20:56 /dev/ttyS6
crw-rw---- 1 root dialout   4, 71 Jan  3 20:56 /dev/ttyS7
crw-rw---- 1 root dialout   4, 72 Jan  3 20:56 /dev/ttyS8
crw-rw---- 1 root dialout   4, 73 Jan  3 20:56 /dev/ttyS9
 
You have written, that you don't see a /dev/ttyACM0 device in the proxmox, right?
If you can't get the linux, where proxmox is running, to correctly bind the usb stick a transfer to a lxc will not work.

So just to make shure we are on the same side of seeing everything:
you did
Code:
ls -l /dev/tty*
on your proxmox machine?
The output should look like this:
Code:
root@pve:~# ls -l /dev/tty*
crw-rw-rw- 1 root tty       5,  0 Jan 18 11:06 /dev/tty
crw--w---- 1 root tty       4,  0 Jan  3 20:56 /dev/tty0
crw--w---- 1 root tty       4,  1 Jan  3 20:56 /dev/tty1
crw--w---- 1 root tty       4, 10 Jan  3 20:56 /dev/tty10
crw--w---- 1 root tty       4, 11 Jan  3 20:56 /dev/tty11
crw--w---- 1 root tty       4, 12 Jan  3 20:56 /dev/tty12
crw--w---- 1 root tty       4, 13 Jan  3 20:56 /dev/tty13
crw--w---- 1 root tty       4, 14 Jan  3 20:56 /dev/tty14
crw--w---- 1 root tty       4, 15 Jan  3 20:56 /dev/tty15
crw--w---- 1 root tty       4, 16 Jan  3 20:56 /dev/tty16
crw--w---- 1 root tty       4, 17 Jan  3 20:56 /dev/tty17
crw--w---- 1 root tty       4, 18 Jan  3 20:56 /dev/tty18
crw--w---- 1 root tty       4, 19 Jan  3 20:56 /dev/tty19
crw--w---- 1 root tty       4,  2 Jan  3 20:56 /dev/tty2
crw--w---- 1 root tty       4, 20 Jan  3 20:56 /dev/tty20
crw--w---- 1 root tty       4, 21 Jan  3 20:56 /dev/tty21
crw--w---- 1 root tty       4, 22 Jan  3 20:56 /dev/tty22
crw--w---- 1 root tty       4, 23 Jan  3 20:56 /dev/tty23
crw--w---- 1 root tty       4, 24 Jan  3 20:56 /dev/tty24
crw--w---- 1 root tty       4, 25 Jan  3 20:56 /dev/tty25
crw--w---- 1 root tty       4, 26 Jan  3 20:56 /dev/tty26
crw--w---- 1 root tty       4, 27 Jan  3 20:56 /dev/tty27
crw--w---- 1 root tty       4, 28 Jan  3 20:56 /dev/tty28
crw--w---- 1 root tty       4, 29 Jan  3 20:56 /dev/tty29
crw--w---- 1 root tty       4,  3 Jan  3 20:56 /dev/tty3
crw--w---- 1 root tty       4, 30 Jan  3 20:56 /dev/tty30
crw--w---- 1 root tty       4, 31 Jan  3 20:56 /dev/tty31
crw--w---- 1 root tty       4, 32 Jan  3 20:56 /dev/tty32
crw--w---- 1 root tty       4, 33 Jan  3 20:56 /dev/tty33
crw--w---- 1 root tty       4, 34 Jan  3 20:56 /dev/tty34
crw--w---- 1 root tty       4, 35 Jan  3 20:56 /dev/tty35
crw--w---- 1 root tty       4, 36 Jan  3 20:56 /dev/tty36
crw--w---- 1 root tty       4, 37 Jan  3 20:56 /dev/tty37
crw--w---- 1 root tty       4, 38 Jan  3 20:56 /dev/tty38
crw--w---- 1 root tty       4, 39 Jan  3 20:56 /dev/tty39
crw--w---- 1 root tty       4,  4 Jan  3 20:56 /dev/tty4
crw--w---- 1 root tty       4, 40 Jan  3 20:56 /dev/tty40
crw--w---- 1 root tty       4, 41 Jan  3 20:56 /dev/tty41
crw--w---- 1 root tty       4, 42 Jan  3 20:56 /dev/tty42
crw--w---- 1 root tty       4, 43 Jan  3 20:56 /dev/tty43
crw--w---- 1 root tty       4, 44 Jan  3 20:56 /dev/tty44
crw--w---- 1 root tty       4, 45 Jan  3 20:56 /dev/tty45
crw--w---- 1 root tty       4, 46 Jan  3 20:56 /dev/tty46
crw--w---- 1 root tty       4, 47 Jan  3 20:56 /dev/tty47
crw--w---- 1 root tty       4, 48 Jan  3 20:56 /dev/tty48
crw--w---- 1 root tty       4, 49 Jan  3 20:56 /dev/tty49
crw--w---- 1 root tty       4,  5 Jan  3 20:56 /dev/tty5
crw--w---- 1 root tty       4, 50 Jan  3 20:56 /dev/tty50
crw--w---- 1 root tty       4, 51 Jan  3 20:56 /dev/tty51
crw--w---- 1 root tty       4, 52 Jan  3 20:56 /dev/tty52
crw--w---- 1 root tty       4, 53 Jan  3 20:56 /dev/tty53
crw--w---- 1 root tty       4, 54 Jan  3 20:56 /dev/tty54
crw--w---- 1 root tty       4, 55 Jan  3 20:56 /dev/tty55
crw--w---- 1 root tty       4, 56 Jan  3 20:56 /dev/tty56
crw--w---- 1 root tty       4, 57 Jan  3 20:56 /dev/tty57
crw--w---- 1 root tty       4, 58 Jan  3 20:56 /dev/tty58
crw--w---- 1 root tty       4, 59 Jan  3 20:56 /dev/tty59
crw--w---- 1 root tty       4,  6 Jan  3 20:56 /dev/tty6
crw--w---- 1 root tty       4, 60 Jan  3 20:56 /dev/tty60
crw--w---- 1 root tty       4, 61 Jan  3 20:56 /dev/tty61
crw--w---- 1 root tty       4, 62 Jan  3 20:56 /dev/tty62
crw--w---- 1 root tty       4, 63 Jan  3 20:56 /dev/tty63
crw--w---- 1 root tty       4,  7 Jan  3 20:56 /dev/tty7
crw--w---- 1 root tty       4,  8 Jan  3 20:56 /dev/tty8
crw--w---- 1 root tty       4,  9 Jan  3 20:56 /dev/tty9
crw-rw-rw- 1 root dialout 166,  0 Jan 19 10:21 /dev/ttyACM0
crw------- 1 root root      5,  3 Jan  3 20:56 /dev/ttyprintk
crw-rw---- 1 root dialout   4, 64 Jan  3 20:56 /dev/ttyS0
crw-rw---- 1 root dialout   4, 65 Jan  3 20:56 /dev/ttyS1
crw-rw---- 1 root dialout   4, 74 Jan  3 20:56 /dev/ttyS10
crw-rw---- 1 root dialout   4, 75 Jan  3 20:56 /dev/ttyS11
crw-rw---- 1 root dialout   4, 76 Jan  3 20:56 /dev/ttyS12
crw-rw---- 1 root dialout   4, 77 Jan  3 20:56 /dev/ttyS13
crw-rw---- 1 root dialout   4, 78 Jan  3 20:56 /dev/ttyS14
crw-rw---- 1 root dialout   4, 79 Jan  3 20:56 /dev/ttyS15
crw-rw---- 1 root dialout   4, 80 Jan  3 20:56 /dev/ttyS16
crw-rw---- 1 root dialout   4, 81 Jan  3 20:56 /dev/ttyS17
crw-rw---- 1 root dialout   4, 82 Jan  3 20:56 /dev/ttyS18
crw-rw---- 1 root dialout   4, 83 Jan  3 20:56 /dev/ttyS19
crw-rw---- 1 root dialout   4, 66 Jan  3 20:56 /dev/ttyS2
crw-rw---- 1 root dialout   4, 84 Jan  3 20:56 /dev/ttyS20
crw-rw---- 1 root dialout   4, 85 Jan  3 20:56 /dev/ttyS21
crw-rw---- 1 root dialout   4, 86 Jan  3 20:56 /dev/ttyS22
crw-rw---- 1 root dialout   4, 87 Jan  3 20:56 /dev/ttyS23
crw-rw---- 1 root dialout   4, 88 Jan  3 20:56 /dev/ttyS24
crw-rw---- 1 root dialout   4, 89 Jan  3 20:56 /dev/ttyS25
crw-rw---- 1 root dialout   4, 90 Jan  3 20:56 /dev/ttyS26
crw-rw---- 1 root dialout   4, 91 Jan  3 20:56 /dev/ttyS27
crw-rw---- 1 root dialout   4, 92 Jan  3 20:56 /dev/ttyS28
crw-rw---- 1 root dialout   4, 93 Jan  3 20:56 /dev/ttyS29
crw-rw---- 1 root dialout   4, 67 Jan  3 20:56 /dev/ttyS3
crw-rw---- 1 root dialout   4, 94 Jan  3 20:56 /dev/ttyS30
crw-rw---- 1 root dialout   4, 95 Jan  3 20:56 /dev/ttyS31
crw-rw---- 1 root dialout   4, 68 Jan  3 20:56 /dev/ttyS4
crw-rw---- 1 root dialout   4, 69 Jan  3 20:56 /dev/ttyS5
crw-rw---- 1 root dialout   4, 70 Jan  3 20:56 /dev/ttyS6
crw-rw---- 1 root dialout   4, 71 Jan  3 20:56 /dev/ttyS7
crw-rw---- 1 root dialout   4, 72 Jan  3 20:56 /dev/ttyS8
crw-rw---- 1 root dialout   4, 73 Jan  3 20:56 /dev/ttyS9

Yessir, mine looks exactly like that BUT there is NO /dev/ttyACM0. It is connected and I can see it via 'lsusb' but the ACM0 driver does not show up.
 
This is a clear indicator that the driver is not loaded for the usb stick.
Sadly you gave no hind which proxmox version you are running.
But to be honest:
if it is not the actual one 7.3-4 with the actual kernel 5.15.83-1-pve i can't help you.

Maybe you also saw in the listing i gave about the devices the answer to your question of the number 166 :-)

So let's hope that somebody else can you maybe help with this problem, as i'm also "only" a proxmox noob using it since beginning of January.
 
Yes, I am running 7.3-4 with kernel 5.18.83-1-pve. I guess I'll re-install and see if that works. Not that it matters, but I have proxmox installed on a 2014 late mac-mini.
 
I believe I have solved it. I found a mention in another thread. I had been passing my USB stick through to another VM using the Proxmox GUI 'Hardware' for that VM. When I removed that and rebooted, /dev/ttyACM0 now shows up in the LXC.

Thanks!
 
Good that you were able to solve this, all would have been a lot easier if you gave this little bit of information
a little bit earlier.

Because if you had mentioned that you used that stick earlier in a vm and had it pass-through there that would have been a big hint.

For the future please try to give as much information as possible.
 
Good that you were able to solve this, all would have been a lot easier if you gave this little bit of information
a little bit earlier.

Because if you had mentioned that you used that stick earlier in a vm and had it pass-through there that would have been a big hint.

For the future please try to give as much information as possible.
I honestly completely forgot about it.

That said, I am still getting permission problems on the LXC. the ZwaveJS program can't open the /dev/ttyACM0 serial port. What do your permissions look like in the LXC?
 
The information regarding the permissions is in the postings above:
it is 666 (or more readable rw-rw-rw):
Code:
crw-rw-rw- 1 root dialout 166,  0 Jan 19 10:21 /dev/ttyACM0
Does yours differ?

Inside the lxc at least the "crw-rw-rw" part should be the same.
 
It did not, but I found the issue. I had created the container as unprivileged. I changed it to privileged and now it works great. It looks like I would have to manually change permissions to use it unprivileged.

Is yours privileged?
 
Last edited:
No, my is unprivileged.

And for the "change manual the permissions": Thats what the udev rule is for :-)
But hey, you found a way which works for you.
 
Last edited: