Linux VPS

Proxmox command line cheat sheet: qm, pct, pvesm and pvecm

The Proxmox commands admins use daily: manage VMs with qm, containers with pct, storage with pvesm, clusters with pvecm, and backups with vzdump, with examples.

IntermediateProxmox VE2 min read

The web UI covers most tasks, but Proxmox commands are faster for scripting, bulk changes and fixing things when the UI is unavailable. Run them as root on the node, through SSH or Node → Shell.

Before you start

  • Root shell on a Proxmox node.
  • Know your guest IDs: qm list for VMs, pct list for containers.

Virtual machines with qm

TaskCommand
List VMsqm list
Start / shutdown / stopqm start 105, qm shutdown 105, qm stop 105
Rebootqm reboot 105
Show configqm config 105
Change memory and coresqm set 105 --memory 4096 --cores 2
Grow a diskqm resize 105 scsi0 +10G
Snapshot / rollbackqm snapshot 105 pre-update, qm rollback 105 pre-update
Cloneqm clone 9000 120 --name web2 --full
Remove a stale lockqm unlock 105
Delete VMqm destroy 105 --purge

Containers with pct

TaskCommand
List containerspct list
Start / stoppct start 110, pct stop 110
Open a shell insidepct enter 110
Run one commandpct exec 110 -- apt update
Change resourcespct set 110 --memory 2048 --cores 2
Grow root diskpct resize 110 rootfs +5G

Storage, cluster and backups

TaskCommand
Storage statuspvesm status
List content of a storagepvesm list local
Cluster statuspvecm status
Back up a guest nowvzdump 105 --storage backups --mode snapshot --compress zstd
Restore a VM backupqmrestore /path/vzdump-qemu-105.vma.zst 130
Version infopveversion -v

Warning: qm destroy and qm stop act immediately with no confirmation. Double-check the ID first.

Troubleshooting

  • "VM is locked": wait for the running task, then qm unlock.
  • "no such VM": the VM lives on another cluster node; run the command there or check pvesh get /cluster/resources.

Frequently asked questions

Is there an API for these?

Yes, pvesh calls the same REST API from the shell, and remote tools can use API tokens (API tokens).

Do CLI changes show in the web UI?

Yes, both edit the same configuration files.

Where are VM config files?

In /etc/pve/qemu-server/<id>.conf, and containers in /etc/pve/lxc/.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.