You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using usbipd-win, I can attach my USB camera to the docker-desktop distro.
/dev/video0 is visible in the docker-desktop distro, but not in the container: when I do lsusb in my container, the camera is visible, but the output of ls /dev does not list video0.
Hi @salvatoreTorsello I use usbipd successfully to forward a USB device to a docker container. For that I had to map -v /dev:/dev and add --privileged so the container can access the devices. Depending on you device you have to install drivers for it in WSL2 thought.
Adapting it, I tried these configurations (docker compose file), with or without privileges, with or without the devices part,
I have tried again, and it seems that rebooting the computer has made /dev/video0 visible.
Unfortunately, despite the presence of /dev/video0 in the container I cannot access the device. I have tried :
setting the container to be privileged
adding my container user to the video group
It does not work.
The only solution I have found which works is to enter the docker-desktop system
wsl --distribution docker-desktop
and change the owner of /dev/video0 to one with UID:GID = 1000:1000
chown 1000:1000 /dev/video0
The container now has access to the host's camera.
Description
I am looking to share my USB camera to a docker container.
WSL kernel is compiled with USB Camera drivers based on version
5.15.133.1
; Tutorial provided by @AgileDevArt available here: https://youtu.be/t_YnACEPmrM?feature=shared&t=183.Using usbipd-win, I can attach my USB camera to the docker-desktop distro.
/dev/video0
is visible in thedocker-desktop
distro, but not in the container: when I dolsusb
in my container, the camera is visible, but the output ofls /dev
does not listvideo0
.Reproduce
Based on discussion dorssel/usbipd-win#315, I performed these steps:
cheese
: it works./dev/video0
is visible in thedocker-desktop
distro.Adapting it, I tried these configurations (docker compose file), with or without privileges, with or without the devices part,
Expected behavior
I should see
/dev/video0
in my container.docker version
Client: Cloud integration: v1.0.35+desktop.11 Version: 25.0.3 API version: 1.44 Go version: go1.21.6 Git commit: 4debf41 Built: Tue Feb 6 21:13:02 2024 OS/Arch: windows/amd64 Context: default Server: Docker Desktop 4.28.0 (139021) Engine: Version: 25.0.3 API version: 1.44 (minimum version 1.24) Go version: go1.21.6 Git commit: f417435 Built: Tue Feb 6 21:14:25 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.28 GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Diagnostics ID
DF60968E-0B48-4B08-B771-845E49E521A1/20240229140159
Additional Info
Copy of this post in the usbipd project discussions: dorssel/usbipd-win#879; @dorssel advised me to also post my problem to WSL's GitHub repository: microsoft/WSL#11230.
Windows version
Microsoft Windows [version
10.0.22631.3155
]WSL Version
2.0.14
Are you using WSL 1 or WSL 2?
I am interested in any advice, whether or not it concerns WSL, Docker Desktop for Windows or usbipd.
Best regards,
Guillaume Nibert
The text was updated successfully, but these errors were encountered: