LinuxCommandLibrary

qm-set

Set Proxmox VM/CT configuration

TLDR

Set a name for a VM in the GUI

$ qm set [100] --name [vm_name]
copy

Set a VM to autostart on boot
$ qm set [100] --autostart [0|1]
copy

Set the allotted core count of a VM
$ qm set [100] --cores [4]
copy

Set the allotted amount of memory
$ qm set [100] --memory [8192]
copy

Give a VM a network device and bridge it to the host network
$ qm set [100] --net[0] [virtio|e1000|rtl8139|vmxnet3],bridge=vmbr[0]
copy

Delete a device
$ qm set [100] --delete [device_name0,device_name1,...]
copy

Passthrough a GPU device to the guest
$ qm set [100] --hostpci[0] [0000:00:02],x-vga=1 --bios ovmf
copy

SYNOPSIS

qm-set message-ID [flag] [attribute value]
This represents a generalized syntax, as qm-set often acts as a prefix for more specific commands (e.g., qm-set-dt) or takes various types of flags/attributes. The simplest common form involves setting a status flag for a given message ID.

PARAMETERS

message-ID
    The unique identifier of the message within the qmail queue. This ID is typically a hexadecimal string representing the message's inode number or a path to the message file.

flag
    An optional single-character flag to set the message's status. Common flags include:
    d or D: Mark message as delivered or to be deleted.
    f or F: Mark message as failed.
    p or P: Mark message as pending for re-delivery.

attribute
    (Less common for qm-set itself, more for qm-set-* variants) Specifies a particular message attribute to modify, such as delivery time or recipient status.

value
    The new value for the specified attribute.

DESCRIPTION

qm-set is a specialized utility within the qmail Mail Transfer Agent (MTA) ecosystem. It is designed for administrators to directly manipulate the state and attributes of messages residing in the qmail message queue. Unlike general-purpose Linux commands, qm-set is highly specific to qmail installations and is not universally present. Its primary function is to allow fine-grained control over individual messages, enabling actions such as marking messages for re-delivery, setting their delivery status (e.g., pending, failed, delivered), or modifying certain message-specific parameters. This command is invaluable for troubleshooting, queue management, and recovering from specific mail delivery issues. Due to its direct interaction with critical queue files, qm-set often requires elevated privileges, typically root, or specific file permissions related to the qmail-queue daemon. Its exact functionality and available options can vary slightly depending on the qmail version, applied patches, or specific third-party tools that might incorporate or wrap its underlying capabilities.

CAVEATS

Part of the qmail MTA suite; not a standard or universal Linux command. Its presence and exact behavior depend on the qmail installation and specific patches.
Requires root privileges or specific permissions to the qmail queue directories for most operations.
Direct manipulation of the qmail queue can lead to data corruption or mail delivery issues if not performed with caution and understanding of the qmail queue structure.

QUEUE STRUCTURE INTERACTION

qm-set operates by directly modifying flags and data within qmail's distinct on-disk queue structure, which consists of multiple directories (e.g., todo, local, remote, intd). It typically targets specific message files identified by their unique IDs to alter their state or attributes, making it a low-level, powerful tool for advanced queue management.

COMMON USE CASES

Common uses include:
    - Forcing re-delivery of stuck messages.
    - Marking specific messages as failed to prevent further delivery attempts.
    - Deleting malicious or unwanted messages directly from the queue.
    - Adjusting the next delivery attempt time for a message (often via qm-set-dt).

HISTORY

The qmail MTA was originally developed by Daniel J. Bernstein (DJB) and released in 1995. The concept of qm-set as a utility to manipulate qmail's unique queue structure emerged from the need for administrative control over mail messages. While a specific qm-set command might not have been part of the original core qmail distribution in its current form, various patches and third-party tools developed around qmail's extensible architecture introduced utilities with similar functionality or naming conventions (e.g., qm-set-dt for delivery time). These tools collectively address the need to manage message states, re-queue items, or force specific actions within the qmail system, reflecting its ongoing development and adaptation by the community.

SEE ALSO

qmail-queue(8), qmail-send(8), qmail-inject(8), qmHandle(1), qmail(7)

Copied to clipboard