Unprivileged vs privileged LXC containers in Proxmox VE

Unprivileged containers are the default starting point in Proxmox VE. This page explains the trade-offs of user namespace mapping, AppArmor, nesting and keyctl, and when a VM is the safer home for a workload.

On this page

Unprivileged vs privileged LXC containers in Proxmox VE: which one to run

Run an unprivileged container unless a specific feature of the workload cannot work without privilege, and move the service to a KVM virtual machine when it needs broad kernel control. Proxmox Virtual Environment integrates the KVM hypervisor and Linux Containers (LXC) on one platform with software-defined storage and networking, so both options sit on the same cluster, backup and access model. The privilege question is really about isolation inside the container layer. The right level depends on the workload, the data it touches and what your security team needs to review, so record the decision per service instead of setting one cluster-wide default.

The main difference is how root inside the container maps to the host. An unprivileged container uses user namespace mapping, so UID 0 inside the container corresponds to an unprivileged ID range on the host, which limits what a compromised process can do to host files and devices. A privileged container has no such mapping, so root inside it is much closer to root on the host. AppArmor profiles apply in both modes and supplement the mapping. Expect the mapping to surface on bind mounts: host files owned by IDs outside the mapped range appear with the wrong owner or cannot be written, which is often the first failure teams hit after switching to unprivileged.

Start every service as unprivileged, then add only what fails. Options such as nesting and keyctl are features you enable on specific containers, and some workloads, Docker among them, depend on them, which is where the trade-off appears. Confirm in the Proxmox VE documentation for your exact version which features each mode allows and what each one weakens, starting with the administration guide introduction. If a workload needs privileged mode or software that expects full kernel control, plan a KVM virtual machine, where the guest runs its own kernel. Record the chosen level, the enabled features and the owner in your service inventory so auditors and the next operator can see why it was chosen.

Which privilege setting fits which workload

This table compares unprivileged containers, privileged containers and the nesting, keyctl and FUSE-style feature flags by what each enables, what each weakens and the workloads where each fits. Read each row as a decision: find the workload you are placing, then check the risk column before you accept the default.

SettingWhat it enables and weakensWhen it fits
Unprivileged container (default)Root inside the container maps to an unprivileged host UID range, so a container escape lands on an unprivileged host user. Some kernel features and device access are restricted.Most stateless services, web apps and databases that run without special kernel access. This is the starting point for any new container.
Privileged containerContainer root maps to real host root, so a breakout gives host-level access. Device and kernel access is broader, and the AppArmor confinement is typically relaxed.Only when a specific device or kernel interface cannot work unprivileged and the workload is trusted, isolated on its own network and not shared with other tenants.
Nesting enabledAllows the container to run its own container runtime or namespaces. It widens the kernel surface reachable from inside the guest and usually needs careful AppArmor handling.Docker or Podman inside an LXC container, where the runtime must create namespaces. Confirm the Docker-in-LXC trade-offs before you choose this over a VM.
keyctl enabledLets the container use the kernel keyring. Some container runtimes and tools need it to start, but it adds another kernel interface to the attack surface.Docker images or services that report keyring errors at startup. Enable it only after you have confirmed the error and the tool requirement.
FUSE-style needsMounting user-space filesystems inside the container requires device access that unprivileged containers often lack, so the setting may weaken isolation.Workloads such as some SMB or sshfs mounts. Check whether a host-side mount with a bind point avoids the need first.
Mounts with file ownership issuesHost-owned data on bind mounts keeps host UIDs, so an unprivileged container's mapped root cannot write to it. Permissions look wrong inside the guest.Shared data directories used by unprivileged containers. Plan UID and GID mapping before the first start, not after data has been written.
A virtual machine insteadFull kernel isolation and standard device access, at the cost of more memory and disk overhead and a separate guest OS to patch.Workloads that need privileged features on a shared host, multi-tenant boundaries, or Docker and Kubernetes stacks that the LXC features do not cover reliably.

Nesting, keyctl and AppArmor: when each feature is needed

Running a container engine inside an LXC container is the most common reason to enable nesting. The inner engine needs to create its own namespaces, mount filesystems and manage cgroups, which an unprivileged container does not allow by default. Enabling nesting lets the inner engine do this work, but it also exposes more kernel interfaces to the workload than a plain container does. Treat the feature as a deliberate exception and record which workload needs it.

  • What it changes: the container may create nested namespaces and mount certain pseudo-filesystems, so the inner engine can start its own containers.
  • Security cost: a compromise of an inner container has a larger kernel surface to probe than in a container without nesting.
  • Storage driver: confirm which storage driver the inner engine uses, since overlay-based drivers depend on the host kernel and the underlying filesystem.
  • Test before go-live: start, stop and restart the inner containers, run a network-connected service, and confirm that the inner engine survives a container reboot.
  • Scope: Docker-in-LXC trade-offs, including when a VM is the better home, are covered on the sibling page on running Docker on Proxmox VE.

Before approving nesting, check that the workload cannot run on a VM or as native services, and document the exception with an owner and review date.

How to choose and configure the privilege level

This sequence turns a container privilege decision into a documented, tested configuration. It starts from what the workload actually needs, keeps the container unprivileged by default, and adds capabilities only when a specific failure proves they are required.

  1. Inventory the workload's privilege needs

    The application owner and the platform engineer list what the workload does at the operating system level: which devices it opens, whether it mounts filesystems, runs a nested container runtime, uses kernel keyrings, or writes to paths owned by specific system users. Record each item with the reason it is needed. The output is a short written list of requirements, and the step is done when every requirement names a concrete function rather than a general expectation that the service might need more access. Confirm with the vendor's installation documentation whether it asks for any of these features.

  2. Default to an unprivileged container

    Create the container as unprivileged unless the inventory produced a requirement that cannot be met otherwise. In Proxmox VE, unprivileged containers map container root to an unprivileged user range on the host, so a process that escapes the container lands on a host account with no administrative rights. The check is in the container options: the unprivileged setting is on, and the container starts from the web interface or the CLI. Record the choice and the reason in the change ticket so later reviewers know it was a deliberate default.

  3. Test the application against mapped IDs

    Start the application in the unprivileged container and run its normal functions: service start, a login, a write to its data directory, and a scheduled job if it has one. Failures usually appear as permission denied errors on files that the host shows as owned by an unmapped numeric ID. Note each error with the path and the user the process runs as. The step is complete when the application passes its functional checks or every failure is written down with its cause, so the next step only addresses real errors.

  4. Fix ownership before adding features

    Resolve the permission failures from the previous step first by changing ownership or access on the data the application writes, using the mapping that Proxmox VE applies to the container. Prefer correcting file ownership inside the container over broadening permissions on the host. Re-run the functional checks after each change. This step is done when the application runs with no permission errors in its logs and the data directory has the ownership the service expects.

  5. Add only proven features

    If a required function still fails after the ownership fixes, enable the specific container feature that the failure points to, such as nesting or keyctl, and nothing else. Change one feature at a time and restart the container after each change so the result is attributable. Record which feature was added, the error it resolved, and the security implication noted in the Proxmox VE documentation. Confirm the exact option names and any AppArmor implications against the current Proxmox VE container documentation for your version before changing production settings.

  6. Verify mount ownership and permissions

    For every bind mount or mount point, check the owner and mode of the source directory on the host and the view from inside the container. Mapped IDs must match on both sides, and the application user must be able to read and write what it needs without world-writable paths. Test a restart and confirm the data survives. The check passes when the ownership is correct on both sides, the permissions are the minimum the application requires, and a restart does not change them.

  7. Confirm the container runs as expected

    Start the container from a clean state and run the functional checks from the test step again, plus a review of the processes running inside it and the features enabled in its configuration. Compare the result with the written requirements list. The step produces a signed-off configuration record: privilege level, enabled features with reasons, mount ownership notes, and the test results. If the container is later moved, backed up or restored, that record tells the next operator what behavior to expect.

Where the trust boundary sits in each container type

The diagram starts at the Proxmox VE host kernel, which every container shares regardless of type. An unprivileged container runs its root user mapped to an unprivileged, non-root ID range on the host, so a process that escapes its namespace still lacks host root. A privileged container uses root IDs that match the host, so the same escape lands with far more reach. A KVM virtual machine sits behind its own guest kernel, which is why it is usually the safer choice for workloads that need broad kernel access. Check which boundary each workload actually depends on before choosing.

Trust boundaries for unprivileged, privileged and virtual machine guests on one host.

Security risks that differ between privilege levels

A container shares the host kernel with every other container and the host itself, so privilege level decides how far a compromise can travel. The cards below cover the risks that change with that choice and the checks to run before a container goes into service.

Shared host kernel exposure

Every LXC container on a node runs on the same host kernel, whether it is privileged or unprivileged. Unprivileged containers reduce the damage from a container escape by mapping root inside the container to an unprivileged user on the host, but a kernel flaw is still a shared flaw. Check that hosts receive kernel updates on a planned schedule and that you know which containers share each node.

AppArmor profile changes

Proxmox VE applies an AppArmor profile to containers by default, and removing or loosening it widens what a process can reach on the host. Changing the profile is often done to get a service working, so it is easy to leave in place. Record every container whose profile differs from the default, and review each exception as part of the change process.

Feature flags that widen the attack surface

Options such as nesting, keyctl and FUSE-based mounts let a container perform operations that are normally restricted, and each one exposes more kernel interfaces to the workload. Enable only the features the application needs, and document the reason next to the container. Confirm the exact feature list for your Proxmox VE release in the administration guide before you set a policy.

Mounted host paths and write access

A bind mount gives a container direct access to a host directory, and the file permissions on that path decide what a compromised workload can change. Mounts from unprivileged containers also depend on UID and GID mapping, so a path that looks writable may not be writable at all. Review each mount for read-only use where possible and confirm ownership with a test write before go-live.

Management plane access to Proxmox VE

Anyone who controls the Proxmox VE web interface or API can change container settings, add mounts, or open a console, which can bypass the isolation the privilege level provides. Protect the management plane with two-factor authentication, role-based permissions and limited API tokens, and keep it off general user networks. Review who holds the right to edit container options, because that right is effectively root on the host.

User management wiki

Patching the host and templates

Container security depends on both the Proxmox VE host and the root filesystem inside each container, and the template a container was built from often carries old packages. Plan patch windows for the host, and track which templates and containers have not been rebuilt or updated since the last release. Subscription repositories are the recommended source for production hosts, so confirm which repository each node uses.

Questions teams ask before choosing a container privilege level

Is an unprivileged LXC container enough to run Docker?

Often not on its own. Docker inside an unprivileged container usually needs the nesting feature enabled, and some Docker workloads also need keyctl. Those features relax isolation, so the choice depends on what the containers do and how much you trust them. Check your own image list first. Run each workload in a test container with the planned features, confirm it starts and passes its health checks, and record which features it actually required. If the list includes system-level tooling or features that only a privileged container can provide, plan for a VM instead. The sibling guide on running Docker on Proxmox VE covers these trade-offs in more depth.

What drives the effort of testing a privileged container?

The effort follows the number of services, how they touch the host, and how much of the host the container can reach. A privileged container runs with root capabilities on the host kernel, so the test plan needs to cover what each service can read, write and change. The main drivers are the count of applications, custom device or mount access, the number of teams who need to sign off on risk, and whether the container must be reviewed again after each upgrade. Ask any partner for a written test plan that lists each service, the features it requires, the host resources it touches and the acceptance checks for each one.

What does the work need from our team?

You need a named owner for the host, someone who can approve the privilege decision, and an application owner for each container who can confirm the service works after changes. Platform engineers handle the template, mount points, backups and the Proxmox VE hosts. Security reviewers should sign off on the isolation model and any features that weaken it. Without these owners, testing tends to stall at the approval step rather than at the technical work. Agree the owners and the review dates before the test starts.

Can our own team move containers to unprivileged mode without outside help?

Many teams can, if they have Linux and Proxmox VE administration experience and time to test. The hard part is usually not the setting change but the file permissions. Unprivileged containers map container UIDs and GIDs to a different range on the host, so files on bind mounts may need ownership changes, and some services may fail until those are fixed. A team that has run these migrations before can plan around the problem. A team that has not should test on a copy of one container first and keep a rollback path, such as a backup taken before any change.

How long does testing a container typically take?

The duration depends mainly on the application. A simple, stateless service with no special features and no mount points usually takes less time than a stack that needs nesting, keyctl, shared storage and a long data migration. Services with complex startup, many dependencies or strict uptime needs take longer because each change needs a verified restart and rollback. Ask for a timeline that is broken down by container, so each one has its own test, its own acceptance criteria and its own sign-off step. No general figure applies to every environment.

When is a VM the safer choice than a container?

Choose a VM when the workload needs a full kernel, kernel modules, custom device access, or a Docker or Kubernetes setup that would otherwise require privileged containers or weakened isolation. A VM also suits services whose security owner will not accept shared-kernel risk. Containers are lighter and faster to start, so they remain the better fit for simple, trusted services. The cost of a VM is usually more memory and disk overhead per guest, which you should measure on your own hardware before deciding. Confirm the choice against your security policy and the application vendor's support statement.

What do Proxmox VE subscriptions cost, and do they change the privilege decision?

Proxmox VE subscriptions are priced per CPU socket per year. The Proxmox VE pricing page lists Community at 120 euros, Basic at 370 euros, Standard at 550 euros and Premium at 1,100 euros, and it states that all tiers include the same software features. The tiers differ in support tickets, response times and access to the enterprise repository. The privilege choice does not change the license cost, but the support level may affect how quickly you can get help if a privileged container causes a host issue. Confirm current prices on the Proxmox pricing page before budgeting.

Limits to confirm in your own environment

Privilege choices on Proxmox VE depend on details that vary by release, template, storage design and policy. The cards below list the checks to run in your own environment before you pick a privilege level for a container that matters.

Proxmox VE version and Debian base

Confirm which Proxmox VE release you run and the Debian release underneath it, because container behavior and kernel features follow the host, not the guest. Check the support window for that Debian release, since Proxmox VE versions are supported at least as long as Debian security support lasts, roughly 3 years. Confirm that your planned upgrade path keeps the same privilege settings working.

Proxmox VE FAQ

Features your template and application need

List the features the application requires, such as nesting or keyctl, and test them on the exact template you will deploy. Some workloads, including Docker inside a container, ask for features that widen the attack surface. Record which feature is needed by which service so reviewers can see why each setting exists.

Storage and backup handling of mapped IDs

Check that your storage, file sharing and backup tooling preserves the UID and GID mapping used by unprivileged containers. Files written by a mapped root can appear with unexpected owners on a host or in a restore target. Test a backup and restore to a different node or storage before relying on the setup for production data.

AppArmor policy and required access

Confirm that your AppArmor profile allows the access the container needs, such as specific device nodes or mounts, and that you are not disabling it to make a workload start. Review the profile in a test container and log denied operations. Any exception you add should be written down with its reason and an owner.

Shared host kernel in your compliance scope

Containers share the host kernel, so a kernel flaw affects every container on that node. Ask your assessor or compliance lead whether a shared kernel is acceptable for the data classification and isolation requirements of the workload. If the answer is no, plan the workload as a virtual machine instead.

Subscription repository in use

Confirm which package repository each node uses. The enterprise repository requires a valid subscription key and is the recommended choice for production, while the no-subscription repository suits testing and non-production use. Keep host packages and the kernel on the same repository policy so container security updates arrive predictably.

Package repositories wiki

When a KVM virtual machine is the safer choice

A KVM virtual machine gives a stronger boundary than any container setting, so choose a VM whenever the workload needs its own kernel, when the code inside it is not trusted, or when your risk owners require isolation that does not depend on the host kernel. An unprivileged container still shares the host kernel with every other container on that node. The unprivileged flag, the AppArmor profile and the user namespace mapping reduce what a compromised process can reach, but none of them removes the shared kernel. Kernel modules, custom sysctl settings, and some kernel-level features are the clearest cases where a VM is the honest answer.

Docker-heavy stacks are the most common case where teams are pulled toward privileged containers. Running Docker inside an LXC container usually needs nesting and often keyctl, and both widen what the container can touch. If the stack runs several Compose projects, builds images or pulls third-party images, a VM with its own Docker daemon keeps the attack surface and the daemon's privileges inside the guest. Confirm with the vendor and your own tests which features your container runtime needs before deciding, because the privilege you grant for convenience is the privilege an attacker inherits.

Proxmox VE runs KVM guests and LXC containers on one platform, so the choice does not change your management tooling, backups or cluster design. What changes is the risk position you accept. Document the decision as a design record that names the workload, the trust level of its code and users, the features it needs and the owner who accepted the residual risk. Review that record when the workload changes, and check the current Proxmox VE administration guide for the container and VM features your release supports.

How DeployOpen delivers Proxmox VE container work

DeployOpen plans, builds and hands over Proxmox VE container setups inside your own infrastructure, including the privilege decision for each container. We scope the choice against your workloads, mounts and compliance evidence needs, then test and document the result so your team can operate it.

How we scope

  • Engagements are fixed-scope, with the container inventory, privilege level per workload and deliverables agreed in writing before work starts.
  • We record which containers need nesting, keyctl or device access, and why each feature is required for that application.
  • We confirm mount points, UID mapping needs and backup targets for each container so the written scope matches your storage design.

How we build

  • We create unprivileged containers by default and document each exception, including any privileged container and its justification.
  • We configure AppArmor profiles and feature flags per container and test that workloads start and run without broadening access.
  • We verify file ownership on bind mounts and volume mount points against the mapped user ranges before data is moved in.

How we hand over

  • You receive a container register listing privilege level, enabled features, mounts and owners for every container in scope.
  • We document the reasoning for each privileged or feature-enabled container so auditors and security teams can review the decision.
  • Your operators receive runbooks for changing a privilege setting, fixing mount permissions and deciding when a workload should move to a VM.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Before a Proxmox VE major upgrade, we can review container privilege settings and mount permissions against the new release. Confirm the upgrade scope in the written statement of work.
  • Where your organization rolls out new container workloads, we can extend the register and retest the affected containers under the agreed scope.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.