-
Notifications
You must be signed in to change notification settings - Fork 172
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
Gazebo won't connect to Mac XQuartz #167
Comments
I'm not sure how you started the container here, but perhaps it might be easier to first get a basic openGL application working first, like glgears or etc. Here is an example (using nvidia-docker though, so not straightly applicable): NVIDIA/nvidia-docker#136 (comment) I don't know the best way support hardware acceleration for a linux kernel guest VM on a MacOS host (assuming your using Docker for Mac), and I'm not sure how well using the integrated graphics in the VM would work: http://wiki.ros.org/docker/Tutorials/Hardware%20Acceleration#Intel Perhaps you could install gazebo client onto the Mac host and run it locally, pointing to the gzserver running in the docker container on the bridged linux VM, as alluded to in a previous issue: #55 Or perhaps you might have better luck running an Xserver in the same container and simply using VNC to display GUI and desktop remotely: https://github.com/fcwu/docker-ubuntu-vnc-desktop |
On Jun 29, 2018, at 2:56 PM, Ruffin ***@***.***> wrote:
I'm not sure how you started the container here, but perhaps it might be easier to first get a basic openGL application working first, like glgears or etc. Here is an example (using nvidia-docker though, so not straightly applicable): NVIDIA/nvidia-docker#136 (comment) <NVIDIA/nvidia-docker#136 (comment)>
I don't know the best way support hardware acceleration for a linux kernel guest VM on a MacOS host (assuming your using Docker for Mac), and I'm not sure how well using the integrated graphics in the VM would work: http://wiki.ros.org/docker/Tutorials/Hardware%20Acceleration#Intel <http://wiki.ros.org/docker/Tutorials/Hardware%20Acceleration#Intel>
I guess this really is the heart of my question. I had tried the above, and it seems the the Gazebo image already has installed, libgl1-mesa-glx libgl1-mesa-dri Further, a mac doesn’t have a /dev/dri folder. So, that won’t work.
I know that it is possible to run Docker for Mac and to have it connect to XQuartz, as it is explained:
https://blog.jessfraz.com/post/docker-containers-on-the-desktop <https://blog.jessfraz.com/post/docker-containers-on-the-desktop>
https://sourabhbajaj.com/blog/2017/02/07/gui-applications-docker-mac/ <https://sourabhbajaj.com/blog/2017/02/07/gui-applications-docker-mac/>
But, I guess the difference between these containers, and Gazebo is hardware acceleration?
Perhaps you could install gazebo client onto the Mac host and run it locally, pointing to the gzserver running in the docker container on the bridged linux VM, as alluded to in a previous issue: #55 <#55>
It seems that the only supported way to install Gazebo, even just the client, on a Mac is using Homebrew. The problem is that I use Macports a bunch (a different package manager) and they are incompatible with each other (with specific warnings not to use both….)
Or perhaps you might have better luck running an Xserver in the same container and simply using VNC to display GUI and desktop remotely: https://github.com/fcwu/docker-ubuntu-vnc-desktop <https://github.com/fcwu/docker-ubuntu-vnc-desktop>
I just used the Gazebo docker image, and then added x11vnc and xvfb, and managed to get it to run that way. So, I do have a work around. But, it would be great to be able to have an image that “just works” on Docker for Mac.
Thanks,
—Adam
|
@dershow Here's a tool that helps build a docker image that just works: https://github.com/osrf/gzdev It's an alpha version still in development, but as of now it can spawn Gazebo 7, 8, and 9 just fine on Mac, Linux, and perhaps even Windows but it has not been tested there yet. It's most likely not going to run as fast as the homebrew install of Gazebo. Hardware accelerated OpenGL applications running on docker containers are not as performant on Mac systems. Docker needs to use a virtualization layer to run on Mac. There's Docker Toolbox and Docker for Mac, btw. You are probably better off using Docker for Mac as it uses a thinner virtualization layer compared to Docker Toolbox which requires something like VirtualBox to be installed. Here's more info about it https://docs.docker.com/docker-for-mac/docker-toolbox/ So I'm not sure if this is going be a good solution for you, but I hope it helps! Feel free to create a new issue in the gzdev repo if you run into any problems. —David |
Hmm, the two methods for mac seem facilitate confusion. Here was my take home from the docs:
https://docs.docker.com/docker-for-mac/docker-toolbox/#the-docker-for-mac-environment
This seems unavoidable unless one creates a PCI hardware passthrough for the VM, which I am unsure about for a mac hosts. Nevertheless, it seems gzdev will be valuable solution. Another solution could be to use gzweb, like images we build here. If you have docker related issues using those images, feel free to make a new issue. |
I'm running the Gazebo docker on my mac. If I try to run the image, and set the display, I get errors. For example, if I run bash, in docker, and then run gazebo --verbose , I see XQuartz open (so it is trying to connect) and then I get this:
I've searched around, and it seems like this is an accelerated graphics driver issue, but I've not had any luck finding a fix. I know that it is possible to run docker images with gui on a mac, and I've gotten it to run successfully for a test firefox image.
Any suggestions or guidance on this?
The text was updated successfully, but these errors were encountered: