rumpkernel / rumprun-packages

Ready-made packages of software for running on the Rumprun unikernel
Other
202 stars 80 forks source link

Interface creation problems with the erlang example on xen #116

Closed rickpayne closed 8 years ago

rickpayne commented 8 years ago

Using a Xen on Ubuntu 14.04, I've compiled up the rumprun toolchain and built the erlang example. When I try to start it using the erlrun.sh script, I get a failure to create the interface and it never reaches the erlang code.

I have to run the rumprun tool as root to allow it to create the xen domain (otherwise xl complains). Its doing this:

 -I if,vioif,'-net tap,script=no,ifname=tap0' \
 -W if,inet,static,"$ip/24","$gw" \

The result is:

rumprun: rumprun_config: ifcreate vioif0 failed: 22

Tracing the code, I see it calls the SIOCIFCREATE ioctl

2 0x00000000002b4629 in rump_netconfig_ifcreate (

ifname=ifname@entry=0x92ec2d "vioif0")
at /home/rickp/src/rumprun/rumprun/buildrump.sh/brlib/libnetconfig/netconfig.c:76

76 return wrapifioctl(in4so, SIOCIFCREATE, &ifr);

Yet when we arrive in the doifioctl, we hit

2350 case SIOCINITIFADDR: 2351 return EPERM; 2352 }

So before I start doing too much more - is there something I'm doing wrong? Should networking work with Xen and rumprun?

rickpayne commented 8 years ago

So I think ending up at line number 2351 is due to the optimisation. It seems that kauth_authorize_network() isn't allowing the interface creation for some reason.

anttikantee commented 8 years ago

Yea, networking should work. However, the syntax for rumprun -I at least PV Xen is different. I forget the exact form, but IIRC you have to use xenif instead of vioif.

rickpayne commented 8 years ago

Aha, that may explain things, thanks. Is it documented somewhere?

anttikantee commented 8 years ago

It's sort of documented in the usage of rumprun, but poorly.

The story is that the rumprun tool is going away because of problems like this one, but it's not easy beans to come up with a complete replacement.

rickpayne commented 8 years ago

Understood :) appreciate the help. I changed the interface to xenif, and it started but struggling to get packets flowing. I can't connect to the example echo server and ping is not working. I'm getting closer but not quite there yet it seems!

anttikantee commented 8 years ago

I'm almost certain that the network backend configuration for a Xen setup was documented somewhere. But I can't find it now.

Who stole all the documentation?

rickpayne commented 8 years ago

Yes I noticed a some of the xen pages were pretty empty.

Anyhoo, I finally got it working. Using this:

 -I if,xenif \
 -W if,inet,static,"$ip/24","$gw" \

And putting the IP address on the bridge I'm using (xenbr0 in this case), its pinging and I have the echo server working.

Thanks for your help/patience ;)

anttikantee commented 8 years ago

Cool. If you feel really thankful, feel free to regurgitate documentation ;-)

I assume this issue can be closed.

rickpayne commented 8 years ago

Yes, close the issue. I'll make a pass at some documentation in the near future to save someone else my pain :)

anttikantee commented 8 years ago

@rickpayne could you update Rumprun and see if networking on Xen still works? I had to make a few changes, but I don't have a Xen setup for testing.

rickpayne commented 8 years ago

Seems to work on my setup (using the rumprun/packages erlang package).

anttikantee commented 8 years ago

On 02/08/16 13:07, Rick Payne wrote:

Seems to work on my setup (using the rumprun/packages erlang package).

Awesome, thanks!