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 restart <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 delete the VM / CT and all its disks. There is no confirmation prompt by default. Take a backup first if there's any chance you might want the data back — see Backup and Restore.

qm config vs editing the .conf file directly

qm config &lt;vmid&gt; and pct config &lt;ctid&gt; read the file through Proxmox's own parser — output is normalised, comments stripped, pending changes shown separately. Editing /etc/pve/qemu-server/&lt;vmid&gt;.conf or /etc/pve/lxc/&lt;ctid&gt;.conf directly bypasses the parser. Useful for fixing a corrupted config or applying a setting qm set won't accept, but stop the guest first to avoid races. The cluster filesystem (pmxcfs) takes care of propagating the change to other nodes.

Related