[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Mirage OS 2.4 errors on install and mirage-skeleton build



On 29 April 2015 at 15:56, Mindy <mindy@xxxxxxxxxxxxxxxxxxx> wrote:
>>> Third, when I managed to get one of the network samples building, for
>>> example "ping", I couldn't get the unikernel running locally with a
>>> tun/tap
>>> device I created. Even though I use tapctl to create a tap0 device owned
>>> by
>>> my user account, just like the tutorial advises, when I go to execute the
>>> unikernel I still get this error:
>>>
>>> Fatal error: exception Failure("net_tap0")
>>> Raised at file "src/core/lwt.ml", line 788, characters 22-23
>>> Called from file "src/unix/lwt_main.ml", line 34, characters 8-18
>>> Called from file "main.ml", line 47, characters 2-28
>>>
>>>
>>> This is rather cryptic but might indicate that you need to run the
>>> command
>>> using sudo.
>>
>> What does strace show here? It might be permissions but if you made
>> the device owned by your user account it shouldnt be. You may need to
>> make /dev/net/tun world read and write (which is safe to do).
>
> On 14.04.2, I need to run with sudo even if the device is owned by my user,
> I've made it with tunctl -u me, and the mode is u+rwx, otherwise strace
> shows
>
> open("/dev/net/tun", O_RDWR)            = 4
> ioctl(4, TUNSETIFF, 0x7fffb7dd0a20)     = 0
> ioctl(4, TUNSETPERSIST, 0)              = 0
> fcntl(4, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE)
> fcntl(4, F_SETFL, O_RDWR|O_NONBLOCK|O_LARGEFILE) = 0
> socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 5
> ioctl(5, SIOCGIFFLAGS, {ifr_name="tap0",
> ifr_flags=IFF_BROADCAST|IFF_MULTICAST}) = 0
> ioctl(5, SIOCSIFFLAGS, {ifr_name="tap0", ???}) = -1 EPERM (Operation not
> permitted)
>
> So you may need to run it with elevated privileges even if it seems like you
> should be able to get away with running it as yourself.
>
> (Thanks for the bug report; attempting to reproduce it got me to actually
> use the tap interface for the first time.)

I have sent a pull request to fix the requires root issue - it was
trying to bring the interface up which requires root, so long as it is
already up this is fine, I use:

sudo ip tuntap add dev tap0 mode tap user justin && sudo ip link set dev tap0 up

to create interfaces. The disappearing thing is the interface going
down again, it is not a persistence thing, as it is not actually
removed.

In addition it seems that some types of Linux tap devices return 0
when there is nothing to read, rather than EAGAIN as you would expect,
will send another pull request to work around this...

Justin

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.