LinuxCommandLibrary

pct-config

Manage Proxmox LXC container configuration

TLDR

Display the saved configuration

$ pct config [100]
copy

Display the running configuration without pending changes
$ pct config [100] --current
copy

Display configuration of a specific snapshot
$ pct config [100] --snapshot [snapshot_name]
copy

SYNOPSIS

pct config [OPTIONS]

PARAMETERS

vmid
    The unique numeric ID of the Linux Container for which to retrieve or set configuration. This is a mandatory argument.

--arch
    Set the container's architecture (e.g., amd64, i386).

--cpu
    Set the number of CPU cores allocated to the container.

--cpulimit
    Set the CPU limit as a percentage (100 for one CPU core). Values can range from 1 to 10000.

--description
    Add a descriptive text for the container, visible in the Proxmox web interface.

--hostname
    Set the container's hostname.

--memory
    Set the memory limit for the container in MB.

--net
    Configure network device N (e.g., '--net0 bridge=vmbr0,ip=dhcp'). Multiple network devices can be configured (net0, net1, etc.).

--onboot
    Enable or disable automatic container startup on host boot (0=no, 1=yes).

--ostype
    Set the operating system type for the container (e.g., debian, ubuntu, centos, fedora, gentoo, suse, alpine, archlinux).

--rootfs
    Define the root filesystem of the container (e.g., 'local-lvm:10', specifying storage and size in GB).

--swap
    Set the swap space for the container in MB.

--unprivileged
    Convert container to/from unprivileged status (0=privileged, 1=unprivileged). This setting is critical for security and usually requires container recreation.

--nameserver
    Set custom DNS nameservers for the container.

--searchdomain
    Set DNS search domains for the container.

--features
    Enable or disable specific container features (e.g., 'nesting=1,keyctl=1').

--mountpoint
    Configure mount point N for additional storage (e.g., '--mountpoint0 mp=/var/www,volume=local:10/subvol-100-disk-1.raw').

DESCRIPTION

pct-config is a command-line utility within the Proxmox Virtual Environment (PVE) used for managing configuration parameters of Linux Containers (LXC). It provides a unified interface to both query and modify various aspects of a container's setup, such as resource limits (memory, CPU), network interfaces, storage, boot behavior, and more. When invoked with only a vmid, it displays the current configuration of the specified container. When invoked with specific options, it applies changes to the container's configuration. This tool is crucial for administrators to fine-tune container performance, resource allocation, and integrate containers seamlessly into the Proxmox cluster environment, ensuring consistency and proper validation for all configuration changes.

CAVEATS

This command is specific to Proxmox Virtual Environment (PVE) installations and is used exclusively for managing LXC containers. Changes made using pct config are applied to the container's configuration file immediately. However, some modifications (e.g., CPU, memory) may require the container to be restarted to take full effect. Changing the 'unprivileged' status of a container effectively requires a new container to be created and data migrated, as it fundamentally alters the container's security context.

DISPLAYING CURRENT CONFIGURATION

When pct config is executed without any specific configuration options (i.e., no '--' flags), it prints the current, full configuration of the specified LXC container to the standard output. This functionality is invaluable for reviewing existing settings, troubleshooting, or preparing to make informed changes to a container's setup.

APPLYING CONFIGURATION CHANGES

When pct config is executed with one or more configuration options, it attempts to apply those changes to the specified container. Proxmox performs internal validation checks to ensure the proposed configuration is valid and compatible with the system. If successful, the container's configuration file (located typically under /etc/pve/lxc/.conf) is updated. Users should be aware that while the configuration file is updated immediately, the running container may need to be stopped and started again for all changes to take effect, particularly for resource-related adjustments.

HISTORY

The pct-config command is an integral part of the Proxmox Virtual Environment, a Debian-based open-source server virtualization management solution. It was developed as a key component of the pct (Proxmox Container Toolkit) utility to provide a consistent and user-friendly interface for managing Linux Containers (LXC). Its evolution mirrors the increasing adoption and feature set of LXC within Proxmox VE, offering robust control over container parameters without direct manipulation of underlying configuration files, thereby enhancing management efficiency and reducing errors in complex virtualization environments. It complements the qm command used for KVM virtual machines.

SEE ALSO

pct(1), qm(1), pve-cluster(5), lxc(7), lxc.container.conf(5)

Copied to clipboard