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
Access Gazebo installed on a mac host #55
Comments
For debugging the networking setup, it might be easier to use the |
Thx for the quick answer, |
If this is of any help, when forwarding the port and connecting from GAZEBO_MASTER_URI=0.0.0.0:11345, gazebo froze on preparing your world. The output of gz stats is
and gz topic -l
|
Perhaps the trouble stems from the way Docker for Mac uses a VM to host a linux kernel for the docker engine, and the oddities in passing through network traffic through the host->VM->container network interfaces. I have no Mac to test this, but there seem to be a lot of discussion on this topic: If you happen to need just one one containerized gzserver, have you tried using the --net=host run arg? This will bind the container to all interfaces available to the VM (I assume the network bridge interface it uses), circumventing any docker networking. Perhaps this would help to isolate the issue in VM network setup vs the docker network behind it. |
Yes, I indeed think this is where the problem comes from. Thx for the tip but, unfortunately, even using --net=host results in gzclient hanging on waiting for master. |
Is the VM's network configured; i.e. are you able to use netcat to test socket connections from mac host to guest VM? |
@cthorey Did you manage to solve the problem. I think I have exactly the same one :) |
@piotrmilos Unfortunately no, I switched back to a linux machine where everything works as expected. |
Looks like this is a mac issue, not specific to these docker images. Closing for now, but feel free to comment if more debug info surfaces. |
It appears that gazebo is using random TCP ports for its transport layer, and since Mac docker requires you to forward each of the ports individually to map them to the host, this complicates things. We're able to get the gzclient to communicate with the gzserver (running inside the docker), however, it hangs at loading the world. We can reproduce the error by running "gz stats" on the mac host -- which also hangs when trying to connect to the gzserver within the docker (however, gz list -l works fine). This is a minimal application which simply opens a transport subscriber to ~/world/stats. Is there any way to force gzserver to only use certain ports (or a range of ports) in it's random port mapping? |
I assume that you are using gazebo8, aren't you? Probably @caguero could help us with your question. |
I am actually using gazebo7, but we have also tried gazebo8 and saw the same problem. |
does mac docker support host networking? |
The only thing we've been able to deduce is that Mac docker doesn't have a network bridge (docker0) like linux docker does. We've been able to get mac host applications to communicate with mac docker applications (by communicating with the mac host ip or localhost). And mac docker applications to communicate with host applications (by communicating with the mac host ip). However, gzclient and gzserver are having trouble being satisfied in some way or another -- which causes gzclient (or gz stats) to hang on connection. It's important to note that gzserver automatically selects the internal only docker ip network which is not mapped to the mac host network. Perhaps this is the problem. We tried to force GAZEBO_IP so that it uses the mac host ip correctly as "Publicized address" but this did not solve things either. Without any more debug info from either gz process, it's difficult to tell what's attempting, failing and hanging. docker launch:
output:
gzclient launch:
|
Old thread, but I got Gazebo in Docker to work by running both gzserver and gzclient in the Docker then using x11vnc and xvfb to get the display back to my computer, following dershow's hint for his workaround from here #167 (comment)
Then I opened a VNC viewer like "VNC Viewer for Google Chrome" voila |
@himty thanks for the instructions! I was able to get mine working by following the same steps. |
I'm having troubles following along. When I run the last line, I get:
Do you know what I'm missing with the display argument? ============================================== |
Hi,
First, thanks for the great work of maintaining these images.
I tried to reproduce the example in the deployment example.
Everything is working properly except when I tried to connect the gzclient (on my mac machine) to the container.
I just got
I guess this is due to the fact that Per-container IP addressing is not possible on docker-for-mac. I tried to Port forwarding instead mapping 11345:11345 and then setting up GAZEBO_MASTER_URI=0.0.0.0:11345.
This appears to launch gazebo on my mac but then gazebo got stuck on the preparing your world screen.
Can you think of any workaround ?
Thanks
PS : I am running mac osx sierra with gazebo version 8.1.0 install on my mac. The container is also running gazebo version 8.1.0.
The text was updated successfully, but these errors were encountered: