[Solved] "Unsupported device" when adding usb device to virtual machine

Hi

I’ve set up a virtual machine for HassOS (https://www.home-assistant.io/installation/generic-x86-64) and are attempting to add a zigbee usb device.

I’ve used the usb device from a container without problems.

When I stop the container, delete the usb device from it, and attempt to add it to the virtual machine I get this:

root@nas:~# lxc config device add haosvm ttyacm0 unix-char path=/dev/ttyACM0 required=false
Error: Invalid devices: Device validation failed for “ttyacm0”: Unsupported device type

I’ve also tried other variations with same result:

root@nas:~# lxc config device add haosvm ttyusb unix-char path=/dev/ttyACM0 required=false

From Linux Containers - LXD - Has been moved to Canonical it says “Supported instance types: container”, so that may mean this device can’t be added to a VM?

System info:

lxd 4.22 22292 latest/stable canonical✓ -

Ubuntu 18.04

root@nas:~# uname -a
Linux nas 4.15.0-166-generic #174-Ubuntu SMP Wed Dec 8 19:07:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Never mind, found an example here: https://ubuntu.com/blog/usb-hotplug-with-lxd-containers

root@nas:~# lxc config device add haosvm usbstick usb vendorid=1cf1 productid=0030 required=false
Device usbstick added to haosvm