[fpga-miniconf] could not configure /dev/net/tun (tap0): Operation not permitted

Tim 'mithro' Ansell me at mith.ro
Fri Jan 12 13:06:58 AEDT 2018


You might want to check for things like SELinux or AppArmor, the operations
on the tun/tap interfaces might require extra privileges that are getting
blocked?

It could also be that chmod isn't enough and you actually need to do the
"sudo tunctl -t tap0 -u $(whoami)" operation? There also seems to be rumors
on the internet that you need not just rw but execute permission on the
tap/tun interfaces?

I don't actually know a huge amount about how tun/tap interfaces work, so
if anyone else does - please do chime in! :-P

There might be some useful information here;
 * https://en.wikibooks.org/wiki/QEMU/Networking#TAP_interfaces
 * https://www.kernel.org/doc/Documentation/networking/tuntap.txt
 * https://wiki.archlinux.org/index.php/QEMU#Tap_networking_with_QEMU

Hope that helps!

Tim 'mithro' Ansell
PS It would be a good if this script was less of a crufty shell script and
more of a nice elegant Python script. <hint> <hint> :-P


On 12 January 2018 at 03:36, Marc MERLIN <marc at merlins.org> wrote:

> On Thu, Jan 11, 2018 at 07:39:43PM +1100, Tim 'mithro' Ansell wrote:
> > Do you have a /dev/net/tap0?
> >
> > I'm guessing you have failed to have the tap0 be created, you can see the
> > bit of the shell script here -> https://github.com/
> > timvideos/litex-buildenv/blob/master/scripts/build-qemu.sh#L119-L134
>
> I changed this:
> saruman:~# l /dev/net/tap0
> crw-r--r-- 1 root root 10, 200 Jan 10 10:36 /dev/net/tap0
> saruman:~# chmod 666 /dev/net/tap0
>
> But still get:
> + build/arty_net_or1k//qemu/or32-softmmu/qemu-system-or32 -M litex
> -nographic -nodefaults -monitor telnet::10000,server,nowait -serial stdio
> -bios build/arty_net_or1k//software/bios/bios.bin -drive
> if=mtd,format=qcow2,file=build/arty_net_or1k//qemu.qcow2,serial=n25q128a13
> -net nic -net tap,ifname=tap0,script=no,downscript=no -gdb tcp::10001
> qemu-system-or32: -net tap,ifname=tap0,script=no,downscript=no: could not
> configure /dev/net/tun (tap0): Operation not permitted
>
> I guess I'll have to dig deeper into the shell script to see what's
> going on.
>
> > Tim 'mithro' Ansell
> >
> > On 11 January 2018 at 18:11, Marc MERLIN <marc at merlins.org> wrote:
> >
> > > I now got as far as this:
> > > + build/arty_net_or1k//qemu/or32-softmmu/qemu-system-or32 -M litex
> > > -nographic -nodefaults -monitor telnet::10000,server,nowait -serial
> stdio
> > > -bios build/arty_net_or1k//software/bios/bios.bin -drive
> > > if=mtd,format=qcow2,file=build/arty_net_or1k//qemu.
> qcow2,serial=n25q128a13
> > > -net nic -net tap,ifname=tap0,script=no,downscript=no -gdb tcp::10001
> > > qemu-system-or32: -net tap,ifname=tap0,script=no,downscript=no: could
> not
> > > configure /dev/net/tun (tap0): Operation not permitted
> > > (LX P=arty C=or1k) saruman:~/src/fpga/litex-buildenv$ l /dev/net/tun
> > > crw-rw-rw- 1 root root 10, 200 Jan 10 12:15 /dev/net/tun
> > >
> > > Any idea why it doesn't work, just add sudo to it?
> > >
> > > Thanks,
> > > Marc
> > > --
> > > "A mouse is a device used to point at the xterm you want to type in" -
> > > A.S.R.
> > > Microsoft is to operating systems ....
> > >                                       .... what McDonalds is to gourmet
> > > cooking
> > > Home page: http://marc.merlins.org/                         | PGP
> > > 1024R/763BE901
> > > --
> > > fpga-miniconf mailing list
> > > fpga-miniconf at lists.lca2018.linux.org.au
> > > http://lists.lca2018.linux.org.au/mailman/listinfo/fpga-miniconf
> > >
>
> --
> "A mouse is a device used to point at the xterm you want to type in" -
> A.S.R.
> Microsoft is to operating systems ....
>                                       .... what McDonalds is to gourmet
> cooking
> Home page: http://marc.merlins.org/                         | PGP
> 1024R/763BE901
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lca2018.linux.org.au/pipermail/fpga-miniconf/attachments/20180112/885bfa18/attachment-0001.html>


More information about the fpga-miniconf mailing list