Mac VS Code Docker X11 Forwarding

Viewed 433

I am trying to setup X11 forwarding for my project using VS Code and Docker on macOS Big Sur 11.5.1 so that I can run turtlesim using ROS. I downloaded XQuartz 2.8.1 and set it up according to this article. I updated my devcontainer.json in VS Code to have

"runArgs": [
    "--cap-add=SYS_PTRACE",
    "--security-opt",
    "seccomp=unconfined",
    "--privileged",                             // https://github.com/microsoft/vscode-remote-release/issues/550
    "--net", "host",                            // https://github.com/microsoft/vscode-remote-release/issues/550
    "-e", "DISPLAY=host.docker.internal:0",     // https://medium.com/@mreichelt/how-to-show-x11-windows-within-docker-on-mac-50759f4b65cb
    "-v", "/tmp/.X11-unix:/tmp/.X11-unix:rw"    // https://github.com/microsoft/vscode-remote-release/issues/550
]

When I run turtlesim turtlesim_node I get the following errors:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast

However, I am able to see the simulation as well as control it using keyboard teleop. I have found other posts online with the same errors, but the steps have not helped me. When I installed mesa-utils in the docker container, I could call glxinfo in the container, but I was still getting the same errors and I thought the info would display the same results I see when I call glxinfo on my Mac. I have not tried installing nvidia drivers in the docker container because I am not sure if that is possible since my Mac uses the M1 chip. I am new to all of this so I would appreciate any help from you more experienced folks!

0 Answers
Related