Linux USB Devices
Proxmox USB Passthrough
VM
On a VM
root@proxmox:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 1cf1:0030 Dresden Elektronik ZigBee gateway [ConBee II]
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@proxmox:~# qm set 100 -usb0 1cf1:0030
update VM 100: -usb0 1cf1:0030
LXC1
Find the tty device
root@docker:~# tree /dev/serial/
/dev/serial/
└── by-id
└── usb-Nabu_Casa_SkyConnect_v1.0_c48ba7961392ed119cf6cad13b20a988-if00-port0 -> ../../ttyUSB0
Get the numbers (188 in this case)
root@docker:~/zigbee-stack# ls -al /dev/ttyUSB0
crw-rw---- 1 nobody nogroup 188, 0 Nov 8 21:56 /dev/ttyUSB0
On an LXC, add to /etc/pve/lxc/101.conf
lxc.cgroup2.devices.allow: c 188:* rwm
lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir
lxc.mount.entry: /dev/ttyUSB0 dev/ttyUSB0 none bind,optional,create=file
Test writing to USB device
root@docker:~/docker compose run --rm z2m ash
...
/app # test -w /dev/ttyUSB0 && echo success || echo failure
success
Bluetooth
Linux Kernel
Show bluetooth kernel modules
This will show all the connected devices, but lots of times it's not really human-readable.
Watch the dmesg stuff happen as you connect the device.
HCI Config
Use hciconfig2 to check the system Bluetooth devices
Each of these commands gives a Bluetooth Device (BD) Address. The first 3 parts are the vendor code. For example,
| Vendor Code | Company |
|---|---|
| 00:E0:4C | Realtek Semiconductor |
| 14:F6:D8 | Intel Corporation |
systemd
Check systemd status
bluetoothctl
Ubuntu uses a newer version, bluetoothctl3
Check the power state, supported features, and whether it's active:
Disable default Bluetooth device
Change Bluetooth Name
Edit /etc/bluetooth/main.conf to add this line. [General] should already be at the top.
shell title="Restart bluetooth service
sudo systemctl restart bluetooth