Skip to content

Access camera stream on Docker Image in WSL2 #760

Open
@adennaoui97

Description

I will try to make it simple.
I am able to make WSL2 recognize the Intel Realsense camera using usbipd then I built an alternative vmlinux (wsl2 kernel) with multimedia support and replaced it with the existing kernel.
With these changes, I am able to make WSL2 both detect the usb ports (lsusb) and I see /dev/video* and I can get access to video stream (I used cheese for example, and it worked).
When I try to run the Docker image, I bash this file:

docker rm -f foundationpose
DIR=$(pwd)/../
xhost +  # Allow GUI access

docker run --gpus all --env NVIDIA_DISABLE_REQUIRE=1 -it --network=host --name foundationpose \
    --cap-add=SYS_PTRACE \
    --cap-add=SYS_ADMIN \
    --device=/dev/bus/usb:/dev/bus/usb \
    --privileged \
    --security-opt seccomp=unconfined \
    -v $DIR:$DIR \
    -v /home:/home \
    -v /mnt:/mnt \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -v /tmp:/tmp \
    --ipc=host \
    -e DISPLAY=${DISPLAY} \
    -e GIT_INDEX_FILE \
    foundationpose:latest \
    bash -c "cd $DIR && bash"

When I had my work computer that has Ubuntu, this was perfect to get things going so I expected things to be fine now that I use WSL2 on Windows once I solved the camera stream issue on WSL2 but the Docker image does not get it. I can see /dev/video* inside the image, I can see Intel Realsense in the list when I run 'lsusb' but when I launch cheese, I do not get the camera stream.

Anybody had this issue before and how to solve it?

PS: I use WSL integration on Docker Desktop

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions