Proxmox VE, KVM & QEMU (qm, pct, virsh) Cheat Sheet
Proxmox VE is an open-source Debian-based Type 1 hypervisor platform that combines KVM/QEMU (full Virtual Machines) and LXC (lightweight Linux Containers) under one web UI and CLI.
qm for VMs, pct for LXC containers
1 Proxmox VM CLI (qm)
The qm (QEMU/KVM Manager) command controls full Virtual Machines on your Proxmox host
directly from SSH or the node shell.
qm list
running/stopped), RAM, and Boot Disk size.
qm start 100
qm shutdown 100
qm stop 100
qm clone 100 101 --name web-02 --full
--full) named web-02. Omit --full for a linked clone from a template.
qm snapshot 100 pre-update --vmstate
--vmstate). Roll back with qm rollback 100 pre-update or delete with qm delsnapshot 100 pre-update.
qm migrate 100 pve-node2 --online
pve-node2 with zero downtime using --online (requires shared storage or --with-local-disks).
2 Proxmox LXC CLI (pct) & VM vs LXC
The pct (Proxmox Container Toolkit) manages lightweight Linux Containers (LXC) that share
the host's Linux kernel and boot in under 2 seconds.
pct list
pct start 200 && pct enter 200
exit to leave.
pct shutdown 200
pct stop 200 only if it hangs.
pct exec 200 -- apt update
apt update inside the container from the Proxmox host—great for automation scripts.
QEMU VM (qm) vs. LXC Container (pct)
| Feature | QEMU VM (qm) |
LXC Container (pct) |
|---|---|---|
| OS & Kernel | Runs its own kernel (Windows, Linux, BSD) | Shares host Linux kernel (Linux guests only) |
| Boot Time & Overhead | 15–45 seconds • Higher RAM/CPU overhead | < 2 seconds • Near-zero overhead |
| Isolation & Security | Hardware-level isolation (VT-x / AMD-V) | Namespace isolation (use Unprivileged CTs) |
| Live Migration | Zero-Downtime (--online) |
Requires restart mode (brief downtime) |
| Best For | Windows, firewalls (pfSense), Docker hosts, untrusted workloads | Lightweight Linux services (Nginx, Pi-hole, DNS, monitoring) |
3 KVM virsh & qemu-img Commands
If you run plain Linux KVM (Ubuntu, RHEL, Debian with libvirt) without Proxmox,
virsh and qemu-img are your primary CLI tools. Note: qemu-img
also works directly on Proxmox hosts for converting disk images.
virsh list --all
--all, virsh list hides shut-off VMs.
virsh console web-vm
virsh dominfo web-vm
qemu-img info disk.qcow2
qemu-img convert -f vmdk -O qcow2 app.vmdk app.qcow2
4 Networking (vmbr0), VLANs & vzdump Backups
Think of vmbr0 as an invisible managed network switch inside your Proxmox server. Your
physical Ethernet port (e.g., eno1) plugs into one port of vmbr0, and every
VM/CT plugs into the other ports.
cat /etc/network/interfaces
vmbr0 & VLAN bridge config
Verify bridge-vlan-aware yes if you assign VLAN tags (like tag=20) per VM NIC.
qm set 100 --net0 virtio,bridge=vmbr0,tag=20
vmbr0.
vzdump 100 --mode snapshot --compress zstd --storage local
vzdump
Backs up VM 100 while running (snapshot mode) using fast zstd compression to local storage.
•
qm = QEMU Manager (Full VMs)•
pct = Proxmox Container Toolkit (LXC Containers)•
virsh = Virtual Shell (Standard Linux KVM/libvirt)•
vzdump = Backup archive tool (works on both VMIDs and CTIDs!)
5 The Danger Zone: 3 Proxmox & KVM Traps
Avoid these three common mistakes that cause database corruption, broken backups, and full host disks.
qm stop Instead of qm shutdown on Databases
qm stop immediately kills the QEMU process—identical to yanking the power cable out of a running server. Running it on PostgreSQL, MySQL, or Windows Domain Controllers can corrupt in-flight transactions and filesystems. Rule: Always run qm shutdown <vmid> first and only use qm stop if the guest is completely frozen.
qemu-guest-agent Inside VMs
Without qemu-guest-agent installed and enabled in Proxmox VM Options, vzdump backups cannot freeze the guest filesystem (fsfreeze) for crash-consistent backups, the Proxmox UI won't show the VM's IP address, and qm shutdown may be ignored. Rule: Enable "QEMU Guest Agent" in VM Options and install qemu-guest-agent in every Linux/Windows VM.
Every snapshot creates a delta chain that grows every time the VM writes data. Leaving snapshots around for weeks slows disk I/O, bloats storage until the datastore hits 100% full (freezing all VMs), and makes merges risky. Rule: Snapshots are NOT backups—delete them within 24–48 hours after patching and rely on vzdump or Proxmox Backup Server.
# 1. Take a quick rollback point before patching qm snapshot 100 pre-patch --vmstate # 2. Verify guest agent responds & run updates qm guest exec 100 -- apt update # 3. Once verified healthy, clean up the snapshot! qm delsnapshot 100 pre-patch