Ask Your Question
1

Couldn't find an AF_INET address for [] with Virtual Machine

asked 2015-04-02 21:36:12 -0600

l0g1x gravatar image

So i tried a few different things already, primarily this answers: http://answers.ros.org/question/16355... 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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-01-24 15:02:06 -0600

l0g1x gravatar image

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.

edit flag offensive delete link more

Comments

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).

gvdhoorn gravatar imagegvdhoorn ( 2016-01-25 02:54:21 -0600 )edit
1

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.

gvdhoorn gravatar imagegvdhoorn ( 2016-01-25 02:55:21 -0600 )edit

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

l0g1x gravatar imagel0g1x ( 2016-01-26 23:12:02 -0600 )edit

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

l0g1x gravatar imagel0g1x ( 2016-01-26 23:14:59 -0600 )edit
1

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.

gvdhoorn gravatar imagegvdhoorn ( 2016-01-27 02:20:39 -0600 )edit

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').

gvdhoorn gravatar imagegvdhoorn ( 2016-01-27 02:22:12 -0600 )edit

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?

l0g1x gravatar imagel0g1x ( 2016-01-27 14:06:43 -0600 )edit

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.

gvdhoorn gravatar imagegvdhoorn ( 2016-01-30 10:44:29 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2015-04-02 21:36:12 -0600

Seen: 7,031 times

Last updated: Jan 24 '16