Access to nmcli from the inside of an snap using strict confinement

Good morning everyone,

I’m creating a snap where I need to access to nmcli .
From this Access nmcli command from network-manager via interface , I now know that it wasn’t possible to access without including the binary inside the snap.
I managed to get this working, but I was wondering if isn’t there any different/updated way to do that, by using plugs and slots (example), since the more updated info in that thread was 1 year ago.

Thanks in advance.

Including your own copy of nmcli is still the recommended solution here. Not all of the files included in the core and core18 snaps are intended to be part of their contract with application snaps that use them as a base. The AppArmor rules are intended to enforce this.

On an Ubuntu Core system, the core or core18 snaps will be used as the root file system. This means that those snaps need to contain certain services and utilities necessary to bring up a Linux system that are irrelevant to its role as an application runtime. If all these services and utilities were visible to applications then it would limit how Ubuntu Core could be improved.

1 Like