PVE-CT (Proxmox VE Container) USB passthrough issue, attempted various method

Will Smith

New Member
Mar 21, 2022
11
1
3
35
# Problem
The CT container cannot use the USB printer.

# My requirements
To enable the Ubuntu 2204 container deployed by CT to access the printer on 2204.

My Environment
PVE version is 7.4.
The created container is privileged.
The printer is an HP device.

After creating the container, without any operations, I entered the container and used the 'lsusb' command to see the HP device. This should be due to the privileged mode.

lsusb
Code:
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 005: ID 5986:02d5 Acer, Inc Integrated Camera
Bus 001 Device 004: ID 0a5c:21e6 Broadcom Corp. BCM20702 Bluetooth 4.0 [ThinkPad]
Bus 001 Device 003: ID 147e:2020 Upek TouchChip Fingerprint Coprocessor (WBF advanced mode)
Bus 001 Device 007: ID 03f0:f22a HP, Inc HP Laser MFP 136a
Bus 001 Device 002: ID 8087:0024 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 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

According to the obtained information, I modified the configuration items.
Code:
cat >> '/etc/pve/lxc/104.conf' << EOF 
lxc.cgroup.devices.allow: c 189:* rwm 
lxc.mount.entry: /dev/bus/usb/001/003 dev/bus/usb/001/003 none bind,optional,create=dir

EOF

lsusb -vvv
Code:
lsusb -vvv
Bus 001 Device 003: ID 03f0:f22a HP, Inc HP Laser MFP 136a
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x03f0 HP, Inc
  idProduct          0xf22a
  bcdDevice            1.00
  iManufacturer           1 HP Inc.
  iProduct                2 HP Laser MFP 136a
  iSerial                 3 CNB1QB95RH
  bNumConfigurations      1

Just to be safe, I created this file.
nano /etc/udev/rules.d/50-myusb.rules
Code:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="f22a", GROUP="lp", MODE="0666"

And I also restarted the service with the command `udevadm control --reload`.

After restarting the CT container, I still couldn't discover the local printer when using CUPS. I also tried installing the HP driver, but it had no effect. On the same PVE host, I installed a full virtual machine which was able to connect to the printer and work properly. The reason I did this was to save resources since a full virtual machine requires at least 2GB of memory, whereas a CT container may only require 256MB.
 
I am having the exact issue when tyring to pass bluetooth usb to LXC, I wish Proxmox will add the option to pass/add usb to the container reources similler to the VM.
 

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!