VM and CT Management

Help and Info~3 minView script

Curated reference for the qm (VMs) and pct (LXC containers) commands. Listing, lifecycle (start / stop / shutdown / destroy), config inspection, and container-specific operations like exec, enter, push and pull.

Find a VMID or CTID first

Almost every command needs a numeric ID. Use qm list for VMs and pct list for containers. Replace <vmid> / <ctid> in the snippets with the actual ID before running.

Listing and Information

CommandDescriptionAction
qm listList all virtual machines
pct listList all LXC containers
qm config <vmid>Show VM configuration (parsed by qm)
pct config <ctid>Show container configuration (parsed by pct)

Configuration Files (raw)

CommandDescriptionAction
cat /etc/pve/qemu-server/<vmid>.confView raw VM configuration file
cat /etc/pve/lxc/<ctid>.confView raw CT configuration file
nano /etc/pve/qemu-server/<vmid>.confEdit raw VM configuration file (nano)
nano /etc/pve/lxc/<ctid>.confEdit raw CT configuration file (nano)
vi /etc/pve/qemu-server/<vmid>.confEdit raw VM configuration file (vi)
vi /etc/pve/lxc/<ctid>.confEdit raw CT configuration file (vi)

VM Management

CommandDescriptionAction
qm start <vmid>Start a virtual machine. Use the correct <vmid>
qm stop <vmid>Force stop a virtual machine. Use the correct <vmid>
qm shutdown <vmid>Gracefully shutdown a virtual machine
qm reset <vmid>Reset a virtual machine (hard reboot)
qm suspend <vmid>Suspend a virtual machine
qm resume <vmid>Resume a suspended virtual machine
qm destroy <vmid>Delete a VM (irreversible). Use the correct <vmid>

Container Management

CommandDescriptionAction
pct start <ctid>Start a container. Use the correct <ctid>
pct stop <ctid>Force stop a container. Use the correct <ctid>
pct shutdown <ctid>Gracefully shutdown a container
pct reboot <ctid>Restart a container
pct destroy <ctid>Delete a CT (irreversible). Use the correct <ctid>

Container Operations

CommandDescriptionAction
pct exec <ctid> -- getent passwd | column -t -s :Show CT users in table format
pct exec <ctid> -- ps aux --sort=-%mem | headTop memory processes in CT
pct enter <ctid>Enter container shell
pct push <ctid> <source> <dest>Copy file from host to container
pct pull <ctid> <source> <dest>Copy file from container to host

Destroy is irreversible

qm destroy and pct destroy remove the guest configuration and its managed disk volumes. Do not assume that external or bind-mounted data is deleted. The CLI has no confirmation prompt by default. Back up any data you may need before running it; see Backup and Restore.

qm config vs editing the .conf file directly

qm config <vmid> and pct config <ctid> display configuration through Proxmox’s parsers. For normal changes, prefer qm set or the corresponding pct setter. Direct edits to /etc/pve/qemu-server/<vmid>.conf or /etc/pve/lxc/<ctid>.conf bypass the validation and locking in management commands; the file must still remain parseable. Stop the guest and keep a copy before manual repair. pmxcfs synchronises configuration across cluster nodes, not guest disk contents.

Related