docker - Mac VS Code Docker X11 转发
问题描述
我正在尝试在 macOS Big Sur 11.5.1 上使用 VS Code 和 Docker 为我的项目设置 X11 转发,以便我可以使用 ROS 运行 turtlesim。我下载了 XQuartz 2.8.1 并按照这篇文章进行了设置。我在 VS Code 中更新了我的 devcontainer.json
"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
]
当我运行 turtlesim turtlesim_node 时,出现以下错误:
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
但是,我能够看到模拟以及使用键盘遥控操作来控制它。我在网上发现其他帖子也有同样的错误,但这些步骤对我没有帮助。当我在 docker 容器中安装 mesa-utils 时,我可以在容器中调用 glxinfo,但我仍然遇到相同的错误,并且我认为该信息会显示与我在 Mac 上调用 glxinfo 时看到的相同的结果。我没有尝试在 docker 容器中安装 nvidia 驱动程序,因为我不确定这是否可行,因为我的 Mac 使用 M1 芯片。我对这一切都是新手,所以我会感谢你更有经验的人的任何帮助!
解决方案
推荐阅读
- javascript - 获取所有以@字符开头的单词
- php - 至少一个嵌套值大于零的 Elasticsearch 过滤器
- c# - 即使正确安装了软件 VS 2019 C#,所有控件(例如按钮、文本框)在其他 PC 上的显示方式也不是我想要的
- assembly - x86_64 程序集,系统调用写入的输出是否存储在某处?
- python-3.x - 尽管使用了默认参数,但 Get() 返回 None
- reactjs - 使用 TypeScript 输入带有强制变量的 GraphQL 查询
- mysql - MySQL:如何为这个后查询过滤器设置“HAVING”条件?
- javascript - JavaScript Maps——使用“相同”键创建两个值
- html - 即使没有互联网,链接也会显示图像
- python-3.x - 无法使用硒单击登录按钮