0
$\begingroup$

Rosanswers logo

So i tried a few different things already, primarily this answers: http://answers.ros.org/question/163556/how-to-solve-couldnt-find-an-af_inet-address-for-problem/ but for some reason im still getting the Couldn't find an AF_INET address error.

I have a gazebo simulation setup on my desktop machine (14.04 indigo) that im running, and then trying to get my ubuntu VM on my mac to connect with the ros master on my desktop (for rviz and development purposes). Im using Parallels 10 and have two network interfaces configured; 1-shared network between mac and vm, 2-WiFi bridge so that the VM can have a ip address that is on the same subnet as my desktop (to allow one to ping the other, as said is needed in the network setup tutorials).

I editted /etc/hosts on both the desktop:

192.168.1.1     home-pc
192.168.1.2     ubuntu-mac

and my VM :

192.168.1.1     home-pc
192.168.1.2     ubuntu-mac

and then on my desktop (ros master) i edited the ~/.bashrc like so:

export ROS_MASTER_URI=http://home-pc:11311
export ROS_IP=192.168.1.1 

and on my VM i edited ~/.bashrc like so:

 export ROS_MASTER_URI=http://home-pc:11311
 export ROS_IP=192.168.1.2

Im not sure whether the ROS_IP can also simply be the respective hostname or not, but thats what the answers i posted in the beggining said to do, and i was under the impression that that answer was already assuming you followed the NetworkSetup tutorial with having to setup the hostnames properly.

Might be a quick fix, but if anyone could give some insight thatd be great. Cheers


Originally posted by l0g1x on ROS Answers with karma: 1526 on 2015-04-02

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Figured out solution while back: You need to configure your network card option to not be a shared network with your native OS, but instead its own network. For Parallels on OSX I use WiFi Bridged as my VM network option, and this then gives my VM a ip address from the same pool and on the same subnet as my desktop.


Originally posted by l0g1x with karma: 1526 on 2016-01-24

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by gvdhoorn on 2016-01-25:
Not saying this isn't a valid workaround, but in my experience even host only or nat networks when used for host <-> VM comms give the VM an IP. Obviously NAT setups come with their own issues, but as long as the ROS Master listens on the 'host only' IP, I'd expect things to work (it's just IP).

Comment by gvdhoorn on 2016-01-25:
Also: I've re-opened the question, as even though we feel it has been answered now, it would be nice if future readers could still comment on it and / or provide additional answers.

Comment by l0g1x on 2016-01-27:
As far as parallels goes, if the network is specified as 'shared' meaning the VM does not have its own IP address on the same subnet as the machine hosting the VM then I dont think you would be able to ping the VM from a separate desktop unless you maybe setup some port forwarding on parallels

Comment by l0g1x on 2016-01-27:
I dont see any way to setup the port forwarding however. The scenario described above is what happened to me. I could ping my desktop computer from my VM, but could not ping the VM from my desktop. It makes sense to me that it would act that way as the desktop would have no route to get to the VM

Comment by gvdhoorn on 2016-01-27:
According to Network Settings in the user guide (of v6, but ok), 'shared networking' is essentially NAT, so that would require port forwarding (not nice). 'Host only' should work though, as it uses plain IP.

Comment by gvdhoorn on 2016-01-27:\

It makes sense to me that it would act that way as the desktop would have no route to get to the VM

I don't have real experience with Parallels, but depending on the way 'host only' is configured at the IP level, adding routes between the two networks could work (but then, why use 'host only').

Comment by l0g1x on 2016-01-27:
Yes, Host only is what I had to use and it worked. Here is the doc for Port Forwarding. I havent tried it myself though, so it seems possible for both shared and host only. It would be port 11311 right?

Comment by gvdhoorn on 2016-01-30:\

For Parallels on OSX I use WiFi Bridged as my VM network option

and

Yes, Host only is what I had to use and it worked.

I'm confused: my comment was triggered by your answer, where you wrote that you had to use bridged networking. That is different from host only.

Comment by l0g1x on 2016-02-02:
Sorry! I misinterpreted what you said when you said "Host only' should work though, as it uses plain IP." By 'plain ip' i thought you meant that the VM would get a ip from dhcp, as if it where an actual machine. Sorry about that!

Comment by l0g1x on 2016-02-02:
So to correct myself, I have never tried to setup my VM as 'Host only' and then setup port forwarding. I have only had success in specifying a bridged wifi network that allowed for my VM to then have an IP on the same subnet (192.168.x.x ) as my desktop i was trying to communicate with.

Comment by gvdhoorn on 2016-02-02:
With Host Only you cannot use port-forwarding afaik. It might be possible to setup routes between the host only network and your normal network, but that would depend on the VM solution you're using. Bridging definitely works.

Comment by gvdhoorn on 2016-02-02:
In any case: I'm glad you got things to work, but I'm not sure what you did is really related to the issue you reported.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.