LXC USB passthrough issue about USB printer

greenice

New Member
Aug 7, 2022
3
0
1
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 ) .

截图_选择区域_20220808230322.png

Any advice is welcome,

Regards,
 
Hi, I have the same problem but creating an udev rule doesn't work for me... What could be the problem?
I've an HP M1120 MFP laserjet printer, I have already got usb passthrough so lxc container now see the printer but it doesn't print... it stay all the time into pending status.

1688232580715.png

I find printer using "lsusb" command. As you can see it is on /dev/bus/usb/001/003 on pve host. To do usb passthourgh I used this guide.

1688232625581.png

And "service" container rightly see the printer passthrough.

1688233124707.png

After that I added it in cups webui using hplip and foo2xqx driver. I used the old cups setup (on zorin os, another computer) for connection path (hp) so it couldn't be a problem. With the old machine it works fine.

1688233016705.png

But it isn't able to print now... despite it is seen by container and rightly set up in cups... what could be the problem?

The container is privileged... i tried also to follow the suggestion of @fatalwir to get an udev rule but it doesn't work... Pemits remain the same!
I create "50-myusb.rules" into pve host... is right this? But I see this permission:

1688233496471.png
The file echo:

SUBSYSTEMS=="usb", ATTRS{0x03f0}=="067b", ATTRS{0x5617}=="2303", GROUP="users", MODE="0666"

Can someone help me please? And sorry for my english XD
 
Last edited:
The file echo:

SUBSYSTEMS=="usb", ATTRS{0x03f0}=="067b", ATTRS{0x5617}=="2303", GROUP="users", MODE="0666"

Hello, your udev rule doesn't seem right. This is exactly what my rule looks like:
Code:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="04e8", ATTRS{idProduct}=="341b", GROUP="lp", MODE="0666"
 

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!