Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sharing a USB camera with usbipd in a docker container #878

Closed
guillaumenibert opened this issue Feb 29, 2024 · 0 comments
Closed

Sharing a USB camera with usbipd in a docker container #878

guillaumenibert opened this issue Feb 29, 2024 · 0 comments

Comments

@guillaumenibert
Copy link

guillaumenibert commented Feb 29, 2024

Hello everyone, thank your for your work, I am looking to share my USB camera to a docker container.
Based on discussion #315, I performed these steps:

  • I recompiled the Linux kernel for WSL with camera driver support,
  • then attached my camera to WSL using usbipd,
  • tested the camera on the Ubuntu default WSL distribution with cheese: it works.
  • /dev/video0 is visible in the docker-desktop distro, but not in the container:

I tried this tip (#315) from @NikLeberg:

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,

...
privileged: true
volumes:
   - /dev:/dev
   - /run/desktop/dev:/dev
   - /run/desktop/dev/video0:/dev/video0

devices:
   - /dev:/dev
   - /run/desktop/dev:/dev
   - /dev/video0:/dev/video0
...

When I do lsudb in my container, the camera is visible, but the output of ls /dev does not list video0.

I am interested in any advice, whether or not it concerns usbipd or rather WSL/Docker.

Best regards,

Guillaume

--
Docker Desktop for Windows 4.28.0
Usbipd: 4.1.1-dev (from #856)
Host: Windows 11 23H2
Container: Ubuntu 22.04

Repository owner locked and limited conversation to collaborators Feb 29, 2024
@dorssel dorssel converted this issue into discussion #879 Feb 29, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant