I created a LXC in proxmox ve V7.2-7 for cups usb printer.
About USB passthrough
Refer to https://medium.com/@konpat/usb-passthrough-to-an-lxc-proxmox-15482674f11d
LXC config file includes:
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/001 dev/bus/usb/001 none bind,optional,create=dir
From PVE server:
root@greenice:/dev/bus/usb/001# ls -al
total 0
drwxr-xr-x 2 root root 100 Aug 8 22:49 .
drwxr-xr-x 4 root root 80 Jul 23 12:48 ..
crw-rw-r-- 1 root root 189, 0 Jul 23 12:48 001
crw-rw-r-- 1 root root 189, 4 Aug 8 07:34 005
crw-rw-r-- 1 root lp 189, 11 Aug 8 22:49 012
root@greenice:/dev/bus/usb/001# lsusb
Bus 002 Device 007: ID 174c:235c ASMedia Technology Inc. Ugreen Storage Device
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0d8c:0014 C-Media Electronics, Inc. Audio Adapter (Unitek Y-247A)
Bus 001 Device 012: ID 03f0:b511 HP, Inc Deskjet 1010 series
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
From LXC container:
root@cups:~# lsusb
Bus 002 Device 007: ID 174c:235c ASMedia Technology Inc. Ugreen Storage Device
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0d8c:0014 C-Media Electronics, Inc. Audio Adapter (Unitek Y-247A)
Bus 001 Device 012: ID 03f0:b511 HP, Inc Deskjet 1010 series
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@cups:/dev/bus/usb/001# ls -al
total 0
drwxr-xr-x 2 nobody nogroup 100 Aug 8 22:49 .
drwxr-xr-x 3 root root 60 Aug 8 22:49 ..
crw-rw-r-- 1 nobody nogroup 189, 0 Jul 23 12:48 001
crw-rw-r-- 1 nobody nogroup 189, 4 Aug 8 07:34 005
crw-rw-r-- 1 nobody nogroup 189, 11 Aug 8 22:49 012
It seems to be ok. But CUPS stills can't find usb printer ( HP, Inc Deskjet 1010 series ) .
Any advice is welcome,
Regards,
About USB passthrough
Refer to https://medium.com/@konpat/usb-passthrough-to-an-lxc-proxmox-15482674f11d
LXC config file includes:
lxc.cgroup2.devices.allow: c 189:* rwm
lxc.mount.entry: /dev/bus/usb/001 dev/bus/usb/001 none bind,optional,create=dir
From PVE server:
root@greenice:/dev/bus/usb/001# ls -al
total 0
drwxr-xr-x 2 root root 100 Aug 8 22:49 .
drwxr-xr-x 4 root root 80 Jul 23 12:48 ..
crw-rw-r-- 1 root root 189, 0 Jul 23 12:48 001
crw-rw-r-- 1 root root 189, 4 Aug 8 07:34 005
crw-rw-r-- 1 root lp 189, 11 Aug 8 22:49 012
root@greenice:/dev/bus/usb/001# lsusb
Bus 002 Device 007: ID 174c:235c ASMedia Technology Inc. Ugreen Storage Device
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0d8c:0014 C-Media Electronics, Inc. Audio Adapter (Unitek Y-247A)
Bus 001 Device 012: ID 03f0:b511 HP, Inc Deskjet 1010 series
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
From LXC container:
root@cups:~# lsusb
Bus 002 Device 007: ID 174c:235c ASMedia Technology Inc. Ugreen Storage Device
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0d8c:0014 C-Media Electronics, Inc. Audio Adapter (Unitek Y-247A)
Bus 001 Device 012: ID 03f0:b511 HP, Inc Deskjet 1010 series
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@cups:/dev/bus/usb/001# ls -al
total 0
drwxr-xr-x 2 nobody nogroup 100 Aug 8 22:49 .
drwxr-xr-x 3 root root 60 Aug 8 22:49 ..
crw-rw-r-- 1 nobody nogroup 189, 0 Jul 23 12:48 001
crw-rw-r-- 1 nobody nogroup 189, 4 Aug 8 07:34 005
crw-rw-r-- 1 nobody nogroup 189, 11 Aug 8 22:49 012
It seems to be ok. But CUPS stills can't find usb printer ( HP, Inc Deskjet 1010 series ) .
Any advice is welcome,
Regards,