Create LXC from template

Virtual Machines~10 min

A wizard that creates an unprivileged Linux container from an official Proxmox template, with its mount points, hardware and network, and checks the whole plan with Proxmox before creating it.

The wizard creates an ordinary Proxmox LXC: it uses the Proxmox API and tasks, and the container it leaves behind is managed from Proxmox like any other. It goes through five steps, System, Access, Resources, Network and DNS and Review, and nothing is created until the plan is confirmed in the last one. The same wizard is available in three places:

WhereHow to open it
ProxMenux MonitorCreate LXC, in the header of the Virtual Machines & Containers card of the VMs & LXCs tab.
Menux tab of the MonitorThe Create LXC from template entry of the Menux tab opens the same wizard.
Console menuMain menu → Create VM and LXC from template or script → Create LXC from template. The steps are the same, as dialogs numbered 1/5 to 5/5 in their title.

Who can use it

In the Monitor the wizard needs the Administrator profile, and the button does not appear for other profiles. In the Menux tab, a profile with Run scripts and tools that is not Administrator gets an Open button in the entry, which runs the console wizard in a terminal; without that action the entry shows only its description. Profiles are described in Users and profiles. The console wizard runs as root. Neither is available on a Proxmox Backup Server host.

System

FieldWhat it sets
NodeThe node the container is created on. In the Monitor it is the node of the Monitor and cannot be changed.
Container ID (VMID)Starts with the next free ID of the cluster.
System templateThe official Proxmox system templates already downloaded for the architecture of the node.
Download an official templateSearches the official catalog, picks the storage for templates and downloads the one chosen, with its progress. When it ends, the wizard returns to System with that template selected.
Container hostnameSuggested from the name of the template, and editable.
Enable nestingOn by default. It allows running containers inside the LXC, such as Docker, and reduces its isolation.
Start when the host bootsOff by default.
Start after creationOff by default. When on, the container is started as the last step of the creation.
Prepare the system for its first bootOff by default. Described below.
System step of the Create LXC wizard with the node, the container ID, the Ubuntu 24.04 template, the hostname and the four switches
The System step, with an Ubuntu 24.04 template and the container started after creation.

The downloaded template is checked against the SHA-512 of the official catalog before it can be used. The Monitor downloads only the system templates of download.proxmox.com, and the console also those of TurnKey. Archives of OCI or Docker images never appear in the list: those are handled by OCI manager Apps. The console wizard also lists TurnKey templates and local archives; for a local archive it asks for its architecture (amd64 or arm64).

Prepare the system for its first boot

Before the first start, two systemd units known to fail in some templates are adjusted on the stopped disk of the container: the certificate is regenerated after ssl-cert, and waiting for the network is skipped when the container has no network. Files that already exist are never overwritten, and nothing is installed or run inside the container. A container with an NVIDIA GPU or USB devices also goes through a preparation before its first start, which sets up those devices; the two units are adjusted only when this switch is on.

Access

The root account of the container can use a Root password, an SSH public key or both. The password has between 5 and 256 characters and is typed twice. Keys are pasted one per line or loaded from a .pub file; ed25519, RSA, ECDSA and security-key types are accepted, up to 32 keys, and a private key is refused.

Resources

FieldDefaultLimits
Container storageThe first storage that accepts containersOnly storages with container content.
Root disk (GiB)81 to 65536.
CPU cores1Up to the cores of the node.
RAM (MiB)51216 up to the memory of the node.
Swap (MiB)5120 disables it.

On LVM-thin or ZFS storage, a disk larger than the free space is allowed with a warning in the review. On other storage it is refused.

Add mount point adds up to 16 mount points of two types:

TypeWhat it createsDefaults
New storage volumeA new volume on the storage chosen, of the size given, mounted at Path inside the container.Read-write and included in the container backups.
Existing host directoryA folder of the host mounted in the container. The path must be absolute and cannot contain symbolic links.Read-only and never included in the backups.

System paths cannot be used inside the container (/etc, /usr, /proc and similar), nor host directories such as /root or the Proxmox folders. Host directories and their permissions in unprivileged containers are explained in LXC Mount Points.

Hardware lists the devices of the host that can be passed to the container: Intel and AMD GPUs by PCI address, NVIDIA (all the GPUs of the host with their driver runtime), Coral TPU, NPU, and USB and serial devices by serial number. USB devices are passed by their identity, so the container keeps them after a reboot. A device already assigned to another guest is refused. The drivers are not installed inside the container: see iGPU acceleration in LXC, NVIDIA drivers on the host and Coral TPU in LXC.

Resources step with the storage, disk, CPU, RAM and swap, a 4 GiB mount point at /data and the hardware of the host
Resources, with a new 4 GiB volume mounted at /data and the devices of the host under Hardware.

Network and DNS

Network bridge starts at No network interface, so a bridge has to be chosen for the container to have network. With a bridge, the container gets its IPv4 address by DHCP, or a static one with Use static IPv4 instead of DHCP, its prefix and an optional gateway. VLAN tag (1 to 4094) appears on bridges that support VLANs. The DNS servers and search domains are left empty to use those of the host. The wizard configures IPv4 only.

Network and DNS step with the vmbr0 bridge, the VLAN tag, the static IPv4 switch and the DNS fields with Use host settings
Network and DNS, with the vmbr0 bridge and the address by DHCP.

Review

Before the review is shown, the plan is checked with Proxmox: the VMID, the template, the storage and its space, the devices and the bridge. The review shows each step with an Edit button to go back to it, and the warnings of the plan, such as nesting or an overcommitted thin storage. Confirm creation creates the container. In the console, the summary offers Create, Modify and Cancel.

Review step with the System, Access, Resources and Network and DNS sections, each with an Edit button, the nesting notice and the Confirm creation button
The review of the plan before it is created.

A checked plan expires

The check is valid for five minutes. If the review stays open longer, Confirm creation answers that the checked configuration is no longer current, and the plan has to be checked again before creating the container.

Creation

The creation shows its steps with the time of each one: Send the request to Proxmox, Create the container and, when requested, Start the container, Prepare the container for its first start or Prepare and start the container. Show log opens the log of the Proxmox task of that step while it runs. Warnings written by Proxmox in the task, if any, appear under their step: they describe the task, not the health of the container.

Creation finished with the three steps checked and their times, the Container created message and the Close, Open terminal and New container buttons
Creation finished, with the container started.

Closing the dialog does not stop the creation: when it is opened again in the same browser tab it shows the operation where it is. When the container has started, Open terminal opens a shell inside it, in the LXC console described in Terminal. That button appears when the wizard was opened from VMs & LXCs, not from the Menux tab.

The container created

The container is always unprivileged, and in Proxmox it has the tags proxmenux, lxc and the name of the distribution, and these Notes with its template, resources, mount points, network and hardware, and a Docs badge that links to this page. If the Notes are changed in Proxmox before the creation ends, they are kept as they are.

Summary of container 151 docs-lab in the Proxmox web interface with the lxc, proxmenux and ubuntu tags and the Notes created by ProxMenux
The container in Proxmox, with its tags and Notes.

From then on it is an ordinary Proxmox LXC: it is backed up, changed, migrated or removed from Proxmox or from the Monitor as any other container, and ProxMenux does not keep it under any management of its own.

Removing the container

In the Monitor, the details window of an LXC has Remove for Administrators, enabled while the container is stopped. The Remove LXC dialog checks the container first and asks to type its ID to confirm. Purge from job configurations also removes it from the replication, HA and backup jobs, and Destroy unreferenced disks owned by the container searches the enabled storages for disks of the container that are no longer in its configuration. Its referenced disks are always destroyed.

When it cannot be removed from the Monitor

The Monitor removes only containers with a single root disk and no special configuration. It refuses, among others, a running, protected or locked container, one with a mount point or an unused disk, one with a host directory, and one with USB devices, a Coral USB or an NVIDIA GPU, which add raw LXC settings. The dialog shows the reason. Use the Proxmox interface to remove containers that the Monitor cannot remove. If removal protection is the only blocker, choose Disable protection… and confirm the change. The Monitor checks the container again. If it is eligible for removal, enter its ID and choose Remove LXC.

What the wizard does not do

  • Privileged containers: the container is always unprivileged.
  • Architectures other than amd64 and arm64.
  • IPv6 addresses and DNS servers.
  • Containers from OCI or Docker images: OCI manager Apps creates those.
  • Raw LXC settings typed by hand, or installing software inside the container.