Skip to content

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

lsmod | grep -i bluetooth

This will show all the connected devices, but lots of times it's not really human-readable.

lsusb

Watch the dmesg stuff happen as you connect the device.

sudo dmesg -w

HCI Config

Use hciconfig2 to check the system Bluetooth devices

hciconfig -a

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

systemctl status bluetooth

bluetoothctl

Ubuntu uses a newer version, bluetoothctl3

bluetoothctl list

Check the power state, supported features, and whether it's active:

bluetoothctl show 00:E0:4C:6A:07:72

Disable default Bluetooth device

sudo systemctl stop bluetooth
sudo hciconfig hci0 down
sudo systemctl start bluetooth

Change Bluetooth Name

Edit /etc/bluetooth/main.conf to add this line. [General] should already be at the top.

sudo nano /etc/bluetooth/main.conf
/etc/bluetooth/main.conf
[General]
Name = MyCustomName

shell title="Restart bluetooth service sudo systemctl restart bluetooth