Classic confinement: when the sandbox is switched off
purpose for app developers for users for administrators
Some programs need to run arbitrary tools from the host which strict confinement cannot allow. Classic confinement lets a snap run with the same access as a traditionally packaged program and gives up the protection of the sandbox. The store reviews every classic snap and the person installing it must pass --classic. It is not available on Ubuntu Core and it costs the developer more upkeep so interfaces are the first thing to try.
On the map: interfaces district
01 A program that has to run your tools
Classic confinement is "provided for apps that need access to arbitrary binaries on the host, which isn't possible when using strict confinement". code-editor is an invented example; IDEs, compilers and terminal emulators are on the store's list of supported reasons.
The photo editor needs your pictures and the network. That's a list, and interfaces grant it piece by piece. Now think of an editor with a terminal in it, where you type make. Let's call it the code-editor snap; it's made up for this deck. What's on its list? Your compiler, your interpreter, your version of git, whatever you installed last week. Nobody can write that down in advance. The documentation gives exactly this as the main reason classic confinement exists: apps that need arbitrary programs from the host. So there's a second mode, where the snap isn't put in the sandbox at all.
02 What is given up
Classic confinement is "equivalent to the full system access that traditional, unsandboxed packages have". The snap is still a snap in every other way: revisions, refresh and revert work the same.
Before you type the flag, be clear what you're agreeing to. For this one snap, the walls aren't there. The docs call classic the most permissive level, equal to the full system access of traditional, unsandboxed packages. The photo editor is held to its own files and what you connected. The code-editor snap can read whatever your account can reach, and run the host's programs too. Its system calls and devices aren't filtered. So you're trusting its developer the way you'd trust any package. The docs say it plainly: a malicious author could easily compromise a system. What you keep is the rest: one file, revisions, refresh and revert.
03 Two agreements before it runs
The store reviews every request for classic confinement, and snap install refuses a classic snap until you repeat it with --classic. snap list shows classic in Notes.
Nobody slips a classic snap onto your laptop quietly. Two parties have to say yes, and one of them is you. The first is the store. The docs say Canonical must vet every classic snap, and without approval from the store team it can't be distributed. Reviewers look at the publisher and at the technical reason. The second is you. A plain snap install stops and tells you, in full, what classic means. So you repeat it with the --classic flag. That's consent, not a formality. Snapd remembers it for that snap, so refreshes don't ask again, and snap list shows classic under Notes.
04 Where it is not available
On Ubuntu Core a classic snap is refused: "requires classic confinement which is only available on classic systems". On some distributions snapd asks for a change to the system before classic snaps install.
You try the same command on the gateway, and it fails, flag or no flag. Classic confinement depends on what kind of system you're on. On an ordinary distribution, like Ubuntu on the laptop, it installs. On Ubuntu Core, snapd refuses a classic snap outright. The store's review page says the same: classic snaps are only supported on classic distributions. That's also why snap find on the gateway doesn't show them. And on a distribution that keeps snaps somewhere else, such as Fedora, snapd wants a link under /snap first, and its message tells you so. Building a device image? Leave classic snaps out.
05 The cost to the developer for app developers
"Classic confinement has a very high maintenance cost": every binary and library in the snap must use what the snap ships, not what the host happens to have. How to build such a snap is Snapcraft's subject.
To a developer, classic looks like the shortcut: no interfaces, no denials. Here's the bill. A strict snap sees its base as its root filesystem, so it only finds your libraries or the base's, the same on every machine. A classic snap sees the host. Now there are two copies of the same library. If one of your binaries picks up the host's copy, it works on your machine and breaks on the next distribution. And every user brings a different host. The docs spell out the duty: everything in the snap must use the libraries, interpreters and dependencies the snap ships. They call it a very high maintenance cost.
06 When not to ask for it for app developers
Requests for classic confinement are reviewed against lists of supported and unsupported reasons. File access, fixed paths and missing libraries have answers within strict confinement; layouts have their own deck. Devmode is for development only.
Before you post a request for classic, read the list of reasons that get turned down. Yours might be on it, with the fix next to it. Files in your home? The home, removable-media or personal-files interfaces. Files under /etc? A layout, or the system-files interface. Hard-coded paths? Layouts again. A library that's only on the host? Ship it in the snap. And "strict was hard to get working" is on the unsupported list by name. Not sure what your snap needs? Install it in devmode: it logs what strict would deny. But a devmode snap can't go to stable, and doesn't refresh by itself.
07 Where to go from here
Roads: the sandbox itself, why confinement is the default, interfaces and their policy, the install flags, the mount namespace and the store.
Classic confinement is the exception: reviewed by the store, agreed to by you, missing on Ubuntu Core, and costly for whoever packages it. For the rule, start at the walls, the sandbox this snap does without. Why snaps explains why confinement is the default. The gatehouse covers interfaces, and the policy deck who decides what a strict snap may connect. Trying and packing a snap has the devmode, jailmode and classic flags. The mount namespace deck shows the filesystem a strict snap sees. And the store deck shows what search offers on each kind of system.
Read more
Strict and classic compared
From the published comparison; rows that the snapd code qualifies are noted.
| Strict | Classic | |
|---|---|---|
| AppArmor | enforce mode | complain mode |
| Seccomp | strict filtering | no filtering (@unrestricted) |
| Device cgroup | always for snaps on core24 and later bases; on older bases only when a device is assigned | not set up |
| Programs it can run | staged packages and the base | staged packages, the base and the host |
| Available on Ubuntu Core | yes | no |
| Needs a flag at install | no | --classic |
| Store review | automatic checks | reviewed by people before it can be distributed |
The published table also says a classic snap has no private mount namespace. snap-confine sets up mount namespace support for classic snaps too when parallel instances are enabled.
Messages
| Message | When |
|---|---|
This revision of snap "<snap>" was published using classic confinement ... repeat the command including --classic. | snap install of a classic snap without the flag |
snap "<snap>" requires classic confinement which is only available on classic systems | on Ubuntu Core, with or without the flag |
classic confinement requires snaps under /snap or symlink from /snap to /var/lib/snapd/snap | on a distribution that mounts snaps elsewhere, such as Fedora |
snap "<snap>" is not compatible with --classic | --classic given for a snap that is not classic |
Once a snap is installed with --classic, later refreshes of it do not need the flag again. snap list shows classic under Notes, unless the snap was installed with --jailmode.
What the store's reviewers accept and decline
Supported categories, from the published review process: compilers; debug tools; IDEs; programming languages; terminal emulators, multiplexers and shells; public cloud agents; Juju helpers; Kubernetes tools requiring arbitrary authentication agents; tools for switching development workspaces; some HPC and orchestration agents; installers for Ubuntu flavours; AI agents that run arbitrary user-directed code.
| Reason given | Answer in the published list |
|---|---|
| access to dot files in the home directory | personal-files |
| access to /etc | layouts or system-files |
| hard-coded paths | layouts |
| software only available on the host | ship it in the snap |
| arbitrary files because of habit | home and removable-media are almost always sufficient |
| difficulty making strict confinement work | not supported |
| running other snaps directly | not supported |
| management snaps; third-party installer snaps | not supported |
On Ubuntu Core, snap find asks the store for strictly confined snaps only; on classic systems it asks for strict and classic ones.
The three modes in one line each
- strict: confined; the default.
- classic: not confined; reviewed; needs
--classic; classic systems only. - devmode: confined but violations are only logged; for development; not for the stable channel and no automatic refresh.
The flags themselves are in Trying and packing a snap.
for app developers for administrators
Installing a classic snap that did not come from the store
The documentation notes that Canonical manages risk only for its own infrastructure and channels: a classic snap obtained elsewhere can be installed by hand by someone who understands the risk. A local file still needs --classic, together with --dangerous if it has no signatures.
Further reading
- Classic confinement: the rationale, the risk and the strict versus classic table
- Snap confinement: strict, classic and devmode from the user's side
- Reviewing classic confinement snaps: the review process and the supported and unsupported categories
- Install modes:
--classic,--devmode,--jailmodeand--dangerous
Roads from here
START HERE
- Why snaps — why confinement is the default
GETTING SNAPS
- The store — what snap find shows on a system without classic support
INTERFACES AND CONFINEMENT
- Confinement — the sandbox that classic confinement does without
- Interfaces — interfaces as the first thing to try
POLICY · who may install and connect what
- Interface policy: the questions snapd asks — who decides what a strict snap may connect
DEVELOPING SNAPS · try, pack, run, debug
- Trying and packing a snap — the devmode and jailmode and classic flags at install
SANDBOX INTERNALS · the mount namespace
- The per-snap mount namespace — the filesystem view a strict snap gets