Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mount /dev/bus/usb on VSCode's devcontainer for docker?

I did this on my devcontainer.json as specified here:

"mounts": ["source=/dev/bus/usb,target=/dev/bus/usb"]

but I got

[2022-03-05T22:04:50.779Z] docker: Error response from daemon: create /dev/bus/usb: "/dev/bus/usb" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.

It looks to me that /dev/bus/usb is already an absolute path

like image 943
Guerlando OCs Avatar asked Sep 02 '25 16:09

Guerlando OCs


1 Answers

You need to specify that this is a bind mount.

"mounts": ["type=bind,source=/dev/bus/usb,target=/dev/bus/usb"]
like image 75
The Fool Avatar answered Sep 04 '25 08:09

The Fool