Character device passthrough

I am in the middle of settting up Home assistant (on initially lxc) for incus VM, I setup udev rules to symlink the needed usb interfaces. However, I have only seen the option to pass the usb interfaces for the character devices using the major and minor version, this seems unseemly granular and maybe unsafe since its unreliable to assume minor version will persist. Is there no way to be more precise, to use something persistent like the symlink?

I’m not 100% clear as to whether you’re trying to do this with a container or virtual machine.

For a container, you can pass any character device you want with incus config device add INSTANCE DEVICE unix-char path=/dev/XYZ, this can be a symlink like those generated for you in /dev/serial or the like.

When dealing with /dev/bus/usb devices for a container, it’s usually best to use a usb device instead so you don’t need to guess the exact path in /dev/bus/usb (especially as it can change).

For a VM, you can’t pass character devices, so you’ll need to instead pass the full USB device in all cases. Selection of a USB device is based on either its productid+vendorid (maybe serial if you’re lucky enough to have a device that has one) or its bus busnum+devnum (location on the USB bus).

Thank you that answers any question I had. :slight_smile: