Interfaces: containers, VMs and support
interface family for app developers for snapd developers for administrators for users
Socket interfaces (docker, lxd, podman, libvirt) grant a client one unix socket; the *-support interfaces let the daemon behind it run containers, with a super-privileged plug that only a store rule can grant.
On the map: interfaces district, family row
01 Two shapes, socket and support
Socket interfaces grant the daemon's socket, plus little else; the daemon behind it holds the privilege. Support interfaces are for the daemon: a system slot and, for nearly all of them, a super-privileged plug that needs a store rule to install. A few, such as lxd-support and docker-support, let the daemon manage its own device cgroup.
Say acme-agent on the gateway should run each job in a container of its own. It asks a daemon, LXD, to build them. That's the first shape in this family. Socket interfaces such as lxd, docker, podman and libvirt grant a client the daemon's unix socket, plus little else. The privilege stays with the daemon. The second shape is for the daemon itself: the support interfaces, like lxd-support. Their slot is the system's, and for nearly all of them the plug is super-privileged: only a snap whose declaration grants it can install. A few, lxd-support among them, also let the daemon manage its own device-cgroup.
02 Two halves of one product
A store-installed daemon snap holds its super-privileged *-support plug, connected by its store rule; that is root. The socket interface is the second half: a client gets access only after snap connect acme-agent:lxd lxd:lxd. snap connections lxd shows both.
So you install lxd on the gateway. It arrives with lxd-support already connected, because the lxd snap's declaration in the store grants that super-privileged plug and auto-connects it. That connection is what lets the daemon run containers at all, and it amounts to root on the device. The second half is the lxd slot, the socket, offered to other snaps. acme-agent plugs lxd and gets nothing until it's connected: snap connect, naming acme-agent's lxd plug and the lxd snap's slot. snapd's own tests connect a client to lxd that way. snap connections lxd then shows both halves.
03 The policy ladder for app developers for Ubuntu Core developers for snapd developers for administrators
libvirt: manual connect allowed, on classic only. docker: deny-connection: on-classic: false. podman: deny-connection: true everywhere. lxd: allow-installation: false on the slot, and deny-connection: true, so a snap-declaration rule decides who may connect.
Why could acme-agent connect to lxd at all? Four socket interfaces, four rungs. libvirt's slot exists only on classic and only denies auto-connection, so an administrator connects a client by hand. docker adds deny-connection, on-classic: false: by hand on classic, but on Ubuntu Core only with a store rule. podman says deny-connection true: even on classic, the client needs a store rule. lxd goes one rung further: the slot has allow-installation: false, so the lxd snap itself needs a declaration to install. Every lxd connection is denied in the base too, so a snap-declaration rule is what lets yours through.
04 What privileged-containers adds for app developers for snapd developers for administrators
The boolean privileged-containers adds /dev/** mrwkl,, change_profile unsafe to any profile and @unrestricted seccomp. Without it the daemon moves to or stacks docker-default. The rules are expanded with InsertAAREExclusionPatterns to leave out snap-confine.
If the gateway ran Docker instead of LXD, the daemon would plug docker-support. Even the plain plug is broad. The daemon can mount, pivot_root, use every capability, and move each container onto the docker-default profile, or stack that profile on its own. docker-support has one attribute, privileged-containers, a boolean, and setting it true adds three more things: raw access to every device file under dev, a change profile to any profile at all, which is how an unconfined container starts, and an unrestricted seccomp filter. AppArmor patterns can't say "everything except", so snapd expands those rules into patterns that leave out snap-confine.
05 lxd-support and the unconfined flag for app developers for Ubuntu Core developers for snapd developers for administrators
Only lxd-support sets appArmorUnconfinedPlugs; with enable-unconfined-mode: true the backend adds the unconfined profile flag when the parser has unconfined and the kernel has policy:unconfined_restrictions.
Back to LXD. Its support plug is already wide: aa-exec with an unconfined transition, so LXD can move to any profile, and an unrestricted seccomp filter. It can go further. lxd-support is the one interface that sets the static flag for unconfined plugs, and its plug attribute enable-unconfined-mode, set true, makes the AppArmor backend write the whole profile with the unconfined flag. That needs the parser to report unconfined and the kernel to report policy:unconfined_restrictions. A strict snap is then deliberately not confined.
06 userns, one line, sometimes omitted for app developers for snapd developers
One AppArmor rule, userns,, plus clone and unshare in seccomp; added only when the parser reports the userns feature. lxd-support, docker-support, greengrass-support, steam-support and browser-support (with allow-sandbox: true) add the line themselves.
Containers need user namespaces, and so do browser sandboxes. Newer AppArmor can mediate creating them, which is why userns exists. It's the smallest interface here: one AppArmor line, userns, plus clone and unshare in seccomp. Before adding the line, snapd checks the parser's features. If userns isn't among them, the interface adds no AppArmor rule; the seccomp lines still apply. lxd-support, docker-support, greengrass-support, steam-support and browser support with allow-sandbox run the same check and add the line themselves, so the LXD daemon doesn't plug userns. The plug is still super-privileged.
07 Where to go from here
Confinement for the profiles; system control and observe for the neighbouring family; workloads for a proposal, not in snapd yet, that would give started programs fewer permissions. The gatehouse and the gatekeepers' hall lead back.
A socket for acme-agent, root for the daemon behind it, and a store that decides who gets which. Here's where to go next. Confinement shows what the profiles these interfaces widen are, and what unconfined means for a process. System control and observe is the neighbouring family: the same super-privileged pattern, aimed at the host rather than a daemon. Workloads is a proposal, not in snapd yet, for giving the programs an app starts fewer permissions than the app itself. And the gatehouse and the gatekeepers' hall lead back to interfaces in general.
08 All 27 interfaces at a glance
Every interface in the family by connection class: 0 auto-connect, 0 conditionally, 22 by hand, 5 need a store rule to connect; 19 are super-privileged.
All 27 interfaces of the containers, VMs and support family at a glance, sorted by how they get connected. 22 connect by hand with snap connect, which is most of the family. 5 need a store rule even to connect: fwupd, lxd, microceph, microovn, podman. 19, marked with a star, are super-privileged and need a store rule to install. 1, in italics, are Ubuntu Touch era and effectively legacy. Every one of them is in the catalogue below this deck, with what it grants and its rule.
Read more
The two shapes
| Socket interface | Support interface | |
|---|---|---|
| Members | docker, lxd, podman, libvirt, microceph, microovn, devlxd, fwupd | the *-support interfaces |
| Used by | a client of the daemon | the daemon itself |
| The plug gets | read and write on one unix socket | what the daemon needs to run containers or VMs |
| Where the slot is | the system on classic (docker, podman, libvirt), or the daemon snap (lxd, microceph, microovn) | the system |
| Store gate | varies, see below | the plug is super-privileged, except acrn-support, adb-support and core-support |
The socket interfaces, from loose to strict
| Interface | Base declaration on the slot | Effect |
|---|---|---|
| libvirt | deny-auto-connection: true | an administrator connects by hand; the slot exists only on classic |
| docker | deny-connection: on-classic: false | by hand on classic; a store rule on Ubuntu Core |
| podman | deny-connection: true | a store rule everywhere |
| lxd, microceph, microovn | allow-installation: false, deny-connection: true | the daemon snap needs a snap-declaration to install, and connections need a store rule |
Gotchas
- Connecting a socket interface gives the client full control of that daemon. For lxd and docker that is close to root on the host.
- Only some support interfaces take over the device cgroup: docker-support, lxd-support, nomad-support, microstack-support, and greengrass-support for its container flavors. snapd then writes no udev tagging rules for that snap, and the interface adds
Delegate=trueto its services. - The family relaxes confinement on purpose in four places: lxd-support's unconfined profile flag, steam-support's
allow all,rule, docker-support's privileged-containers rules, and classic-support's chroot withsudo Uxr. - Every
*-supportplug in this family except core-support refuses parallel instances of the snap. - Without
privileged-containers, docker-support lets the daemon move a container to thedocker-defaultprofile or stack that profile on its own. With it, the daemon may switch to any profile. - greengrass-support accepts any
flavorand emits almost no rules for an unknown one; kubernetes-support checks itsflavoragainstkubelet,kubeproxyandautobind-unix. - firmware-updater-support and ros-snapd-support add no sandbox rules at all; they only unlock parts of the snapd REST API.
- core-support is kept for compatibility and grants nothing.
Further reading
- The lxd-support interface: its attribute and what the store grants.
- The docker-support interface:
privileged-containersand the other plug attributes. - The userns interface: when a snap needs it.
- Super-privileged interfaces: why these plugs need a store declaration.
- Connect interfaces:
snap connectionsandsnap connect.
Roads from here
INTERFACES AND CONFINEMENT
- Confinement — confinement: what the profiles these interfaces widen are
- Workloads — workloads: a proposal for narrower permissions per started program
- Interfaces — back to interfaces
- How interfaces are implemented — how the policy and the backends are implemented
INTERFACE FAMILIES · every interface, grouped by what it touches
- "Interfaces: system control and observe" — the neighbouring family: super-privileged plugs aimed at the host