network namespaces

Jamie Strandboge jamie at canonical.com
Tue Feb 21 17:53:48 UTC 2017


On Tue, 2017-02-21 at 12:39 +0100, Luca Dionisi wrote:
> Are network namespaces supported in snaps?
> 
> In my RaspberryPi3 I have a snap which has been installed with --devmode.
> Inside the snap I have exposed the command 'bash'. I exec that bash as
> root. Then I try to create a network namespace. It fails.
> 
> $ sudo myapp.bash
> # ip netns add ns0
> open("/proc/self/ns/net"): Permission denied
> #
> 

You are hitting this bug:
https://bugs.launchpad.net/apparmor/+bug/1648903

The workaround is to declare in your snap 'plugs: [ network-control ]' and to
connect the interface with 'sudo snap connect myapp:network-control' even when
using devmode. After that you should be able to use 'ip netns' within your snap.

-- 
Jamie Strandboge             | http://www.canonical.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20170221/49ea3cb5/attachment.sig>


More information about the Snapcraft mailing list