Configuring docker dynamic USB memory access with --mount option in VS Code Torizon Extension

Dear Toradex Community,

the --volume option seems not enough to dynamically mount and unmount USB drives and sticks in a docker containers when they are physically plugged and unplugged as mentioned here on serverfault.com. Therefore it is possible to do that using the more powerful --mount option this way:

docker run --rm -it --privileged --mount type=bind,source=/var/rootdirs/media,target=/disks,bind-propagation=shared  torizon/debian:$CT_TAG_DEBIAN /bin/bash

Unfortunately I am not able to configure that option in VS Code. On February I asked an other question about other simpler docker options and the answer was general enough to solve similar issues, but now I am blocked again because the option argument is more complex, being a list of Mounts objects, according to the documentation (link).

Some unsuccessful attempts results in similar config.yaml

extraparms:
    common:
        mounts: type=bind,source=/var/rootdirs/media,target=/disks,bind-propagation=shared
        mounts: '[type=bind,source=/var/rootdirs/media,target=/disks,bind-propagation=shared]'

But no way to make it working. How can I configure it correctly in Torizon VS Code Extension?

Thank you in advance and best regards,

ldvp

Greetings @ldvp,

The value here should be this I believe:
[{ type: "bind", source: "/media", target: "/media", propagation: "shared" }]

Adjust the source/target to your needs but the general format above should be correct.

One thing you need to make sure of is that the value is proper yaml since this gets written to config.yaml. Which then gets parsed by the backend.

Give this a try and let me know how it works out.

Best Regards,
Jeremias

The information provided is helpful.

to accomplish what i’m after requires an entry under “extraparams”.

In VSCode, when i go to Configurations-extraparams, i’m propmted for a ‘key’ then a ‘Value’. Same with Configurations-Volumes, i’m propmted for a ‘key’ then a ‘value’