Virtualization Quick Reference

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.

⚡ Quick Reference🟢 Beginner-Friendly📅 Updated: 2026
CLI Tool qm / pct qm for VMs, pct for LXC containers
Action snapshot Operation to run (start, stop, clone, migrate)
VMID & Name 100 pre-patch Unique numeric ID (100+) & target name/flags

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
List all VMs on this node Shows VMID, Name, Status (running/stopped), RAM, and Boot Disk size.
qm start 100
Power on VM 100 Boots the QEMU virtual machine with ID 100 in the background.
qm shutdown 100
Graceful OS shutdown (Safe) Sends an ACPI/guest-agent shutdown signal so the OS flushes disks and closes apps cleanly.
qm stop 100
Hard power-off (Emergency only) Kills the QEMU process immediately—like yanking the power cord. Use only if frozen.
qm clone 100 101 --name web-02 --full
Clone VM 100 to new VM 101 Creates an independent copy (--full) named web-02. Omit --full for a linked clone from a template.
qm snapshot 100 pre-update --vmstate
Create a point-in-time snapshot Saves disk state (and RAM with --vmstate). Roll back with qm rollback 100 pre-update or delete with qm delsnapshot 100 pre-update.
qm migrate 100 pve-node2 --online
Live-migrate VM to another cluster node Moves running VM 100 to 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
List all LXC containers Displays CTID, Status, Lock state, and Hostname for every container on the node.
pct start 200 && pct enter 200
Start container & open root shell Instantly drops you into a root shell inside CT 200 without needing SSH. Type exit to leave.
pct shutdown 200
Gracefully stop LXC container Cleanly stops services inside CT 200. Use pct stop 200 only if it hangs.
pct exec 200 -- apt update
Run a single command inside CT 200 Executes 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
Show all KVM VMs (running & stopped) Without --all, virsh list hides shut-off VMs.
virsh console web-vm
Attach to VM serial console Connects directly to the VM terminal. Press Ctrl + ] to exit back to host.
virsh dominfo web-vm
Inspect VM CPU, RAM & state Shows UUID, vCPU count, allocated memory, autostart status, and uptime.
qemu-img info disk.qcow2
Check virtual vs actual disk size Reveals format, virtual max size, actual host space used, and backing file chains.
qemu-img convert -f vmdk -O qcow2 app.vmdk app.qcow2
Convert VMware VMDK to KVM QCOW2 Essential when migrating VMs from VMware ESXi/VirtualBox into Proxmox or KVM.

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
Inspect 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
Place VM 100 onto VLAN 20 Tags all traffic leaving VM 100's virtual NIC with 802.1Q VLAN ID 20 on vmbr0.
vzdump 100 --mode snapshot --compress zstd --storage local
Run a live backup with vzdump Backs up VM 100 while running (snapshot mode) using fast zstd compression to local storage.
🧠 Memory Trick — Which CLI Tool Do I Type?
• 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.

⚠️ Critical Proxmox & KVM Warnings
1. Using 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.

2. Forgetting 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.

3. Leaving Snapshots Open Indefinitely

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.

Quick-Copy: Safe Pre-Patch Workflow (Snapshot → Update → Verify → Remove)
# 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