VM and CT Management
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
| Command | Description | Action |
|---|---|---|
| qm list | List all virtual machines | |
| pct list | List all LXC containers | |
| qm config <vmid> | Show VM configuration (parsed by qm) | |
| pct config <ctid> | Show container configuration (parsed by pct) |
Configuration Files (raw)
| Command | Description | Action |
|---|---|---|
| cat /etc/pve/qemu-server/<vmid>.conf | View raw VM configuration file | |
| cat /etc/pve/lxc/<ctid>.conf | View raw CT configuration file | |
| nano /etc/pve/qemu-server/<vmid>.conf | Edit raw VM configuration file (nano) | |
| nano /etc/pve/lxc/<ctid>.conf | Edit raw CT configuration file (nano) | |
| vi /etc/pve/qemu-server/<vmid>.conf | Edit raw VM configuration file (vi) | |
| vi /etc/pve/lxc/<ctid>.conf | Edit raw CT configuration file (vi) |
VM Management
| Command | Description | Action |
|---|---|---|
| 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
| Command | Description | Action |
|---|---|---|
| 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
| Command | Description | Action |
|---|---|---|
| pct exec <ctid> -- getent passwd | column -t -s : | Show CT users in table format | |
| pct exec <ctid> -- ps aux --sort=-%mem | head | Top 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 <vmid> and pct config <ctid> read the file through Proxmox's own parser — output is normalised, comments stripped, pending changes shown separately. Editing /etc/pve/qemu-server/<vmid>.conf or /etc/pve/lxc/<ctid>.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
- Backup and Restore — vzdump and qmrestore / pct restore.
- Storage and Disks — qm importdisk and disk management.
- Help and Info overview.