I have created a tap device (`tap0`) which I would like to provide as a network interface to qemu. I created the device with the following command and attached it to a network bridge I set up:

```
tunctl -t tap0
ifconfig tap0 up
brctl addif virbr0 tap0

```

I then ran the commands suggested in [this answer](https://unix.stackexchange.com/a/18283/1049):

```
chgrp netdev /dev/net/tun
chmod 660 /dev/net/tun

```

Both commands completed successfully and I confirmed that they took effect:

```
nathan@nathan-desktop:~$ stat /dev/net/tun
  File: ‘/dev/net/tun’
  Size: 0           Blocks: 0          IO Block: 4096   character special file
Device: 6h/6d   Inode: 1224        Links: 1     Device type: a,c8
Access: (0660/crw-rw----)  Uid: (    0/    root)   Gid: (  108/  netdev)
Access: 2015-11-16 10:16:35.127338320 -0800
Modify: 2015-11-16 10:16:35.127338320 -0800
Change: 2015-11-16 10:37:18.338948110 -0800
 Birth: -

```

I also confirmed that I am in the `netdev` group:

```
nathan@nathan-desktop:~$ groups
[...] netdev [...]

```

**However,** when I attempted to start a qemu virtual machine with the interface, I encountered the following error:

```
nathan@nathan-desktop:~$ qemu-system-arm [...] -net tap,ifname=tap0
qemu-system-arm: -net tap,ifname=tap0: could not configure /dev/net/tun (tap0): Operation not permitted
qemu-system-arm: -net tap,ifname=tap0: Device 'tap' could not be initialized

```

### strace

The relevant output from `strace` is presented below:

```
open("/dev/net/tun", O_RDWR)            = 7
ioctl(7, TUNGETFEATURES, 0x7ffcc532ab2c) = 0
ioctl(7, TUNSETVNETHDRSZ, 0x7ffcc532ab28) = -1 EBADFD (File descriptor in bad state)
ioctl(7, TUNSETIFF, 0x7ffcc532ab30)     = -1 EPERM (Operation not permitted)
write(2, "qemu-system-arm:", 16qemu-system-arm:)        = 16
write(2, " -net", 5 -net)                    = 5
write(2, " tap,ifname=tap0", 16 tap,ifname=tap0)        = 16
write(2, ": ", 2: )                       = 2
write(2, "could not configure /dev/net/tun"..., 64could not configure /dev/net/tun (tap0): Operation not permitted) = 64
write(2, "\n", 1
)                       = 1
close(7)                                = 0
write(2, "qemu-system-arm:", 16qemu-system-arm:)        = 16
write(2, " -net", 5 -net)                    = 5
write(2, " tap,ifname=tap0", 16 tap,ifname=tap0)        = 16
write(2, ": ", 2: )                       = 2
write(2, "Device 'tap' could not be initia"..., 37Device 'tap' could not be initialized) = 37
write(2, "\n", 1
)

```