USB devices "source" path

Hallo :waving_hand:

Since IncusOS is quite a closed system (which is great), what would be the best way to get USB devices ID or such so that I can then map them to instances ?

Cheers !

Got it !
Just found incus admin os system show resources

Actually, I might require a bit of help here.
It seems like the unix-char device type requires the source path. Therefore, how can I get that on IncusOS ?

What exactly are you trying to pass to the container?

In many cases unix-hotplug can be used as a way to get the devices associated with a USB device to be passed to a container.

Trying to run a zwave-js-server container which requires the path to the zwave dongle !

So i guess that with the following configuration

devices:
  zwave:
    productid: '0200'
    type: unix-hotplug

I would be able to use /dev/zwave as the container path for the device ?

The unix-hotplug stuff should cause the /dev/ttyUSB0 or /dev/ttyACM0 to show up in the container.

Or you can use unix-char and make a guess on the source name. For a zwave dongle, it’s going to be either /dev/ttyUSB0 or /dev/ttyACM0

Wouldn’t be a enhancement to add the source path in the incus admin os system show resources output ?

Yeah, I’m about to file an issue against Incus for us to add something about physical serial devices.

1 Like

Also, what would be the correct interpretation of the following error when trying to start the instance ?

Failed to start device "zwave": Can't create device as devices path is mounted nodev

Ah, that part is a bug in IncusOS, fun, sounds like I’ll be filing two issues :wink:

1 Like

Damn, how am I gonna be turning off my lights tonight !

1 Like

Well, none of these are working.
I’ll be waiting for the fix :slight_smile:

Can you do:

incus config device add NAME tmp-dev disk source=/dev path=/mnt/dev recursive=true

Then do incus exec NAME -- ls -lh /dev/

It requires that the instance to be running but unfortunately, since I can’t get the USB device, the instance refuses to start !

derek@dmbr incus % ./incus exec zjs --project=jarvis -- ls -lh /dev/
Error: Instance is not running

Remove the USB device then start the instance.

The instance won’t start if there is no USB device :wink:
https://hub.docker.com/r/kpine/zwave-js-server

derek@dmbr incus % ./incus console --show-log zjs --project=jarvis                                          
[WARN  tini (21)] Tini is not running as PID 1 and isn't registered as a child subreaper.
Zombie processes will not be re-parented to Tini, so zombie reaping won't work.
To fix the problem, use the -s option or set the environment variable TINI_SUBREAPER to register Tini as a child subreaper, or run Tini as PID 1.
USB path "/dev/ttyUSB0" does not exist or is not a valid serial device

I can start a different instance which will not require that said device, give me a sec

Ah yeah, sorry, forgot that zwavejs fails immediately :slight_smile:

1 Like