ProxMox Cheat Sheet

Here are the essential Proxmox command-line tools for managing VMs and containers:

Core VM Management Commands

qm (QEMU/KVM Virtual Machines)

List and Status:

qm list                    # List all VMs
qm status <vmid>          # Check VM status
qm config <vmid>          # Show VM configuration
qm monitor <vmid>         # Enter QEMU monitor

VM Control:

qm start <vmid>           # Start VM
qm stop <vmid>            # Graceful shutdown
qm shutdown <vmid>        # Graceful shutdown (same as stop)
qm reset <vmid>           # Hard reset VM
qm suspend <vmid>         # Suspend VM to disk
qm resume <vmid>          # Resume suspended VM
qm reboot <vmid>          # Graceful reboot

VM Management:

qm create <vmid> --name <name> --memory 2048 --net0 virtio,bridge=vmbr0
qm clone <vmid> <newvmid> # Clone VM
qm destroy <vmid>         # Delete VM completely
qm migrate <vmid> <target-node>  # Migrate to another node

Configuration:

qm set <vmid> --memory 4096      # Change RAM
qm set <vmid> --cores 4          # Change CPU cores
qm set <vmid> --delete net0      # Remove network interface
qm resize <vmid> scsi0 +10G      # Expand disk by 10GB

Container Management Commands

pct (Proxmox Container Toolkit)

List and Status:

pct list                  # List all containers
pct status <ctid>         # Check container status
pct config <ctid>         # Show container configuration

Container Control:

pct start <ctid>          # Start container
pct stop <ctid>           # Stop container
pct shutdown <ctid>       # Graceful shutdown
pct reboot <ctid>         # Reboot container
pct suspend <ctid>        # Suspend container
pct resume <ctid>         # Resume container

Container Management:

pct create <ctid> <template> --hostname <name> --memory 1024
pct clone <ctid> <newctid> # Clone container
pct destroy <ctid>        # Delete container
pct enter <ctid>          # Enter container shell
pct exec <ctid> -- <command>  # Execute command in container

Configuration:

pct set <ctid> --memory 2048     # Change RAM
pct set <ctid> --cores 2         # Change CPU cores
pct resize <ctid> <disk> <size>  # Resize container disk

Storage and Backup Commands

Storage:

pvesm status              # Show storage status
pvesm list <storage>      # List storage contents
pvesm alloc <storage> <vmid> <filename> <size>  # Allocate disk space

Backups:

vzdump <vmid>             # Backup VM/container
vzdump --mode snapshot <vmid>  # Snapshot backup
qmrestore <backup-file> <vmid>  # Restore VM
pct restore <ctid> <backup-file>  # Restore container

System Information Commands

Node Information:

pvesh get /nodes          # List cluster nodes
pvesh get /version        # Show Proxmox version
pveversion -v             # Detailed version info

Resource Usage:

pvesh get /nodes/<node>/status  # Node resource usage
pvesh get /nodes/<node>/tasks   # Show running tasks

Network:

pvesh get /nodes/<node>/network  # Show network config
ip addr show              # Show network interfaces (standard Linux)

Useful Shortcuts and Tips

Quick VM Operations:

# Start multiple VMs
for vm in 100 101 102; do qm start $vm; done

# Stop all running VMs
qm list | grep running | awk '{print $1}' | xargs -I {} qm stop {}

# Show VM resource usage
qm list | grep -v VMID

Monitoring:

watch "qm list"           # Watch VM status in real-time
htop                      # System resources
iotop                     # Disk I/O monitoring

Log Files:

tail -f /var/log/pveproxy/access.log    # Web interface access
tail -f /var/log/pve/tasks/active       # Active tasks
journalctl -u pveproxy                  # Proxmox web service logs

Template Management

VM Templates:

qm template <vmid>        # Convert VM to template
qm clone <template-id> <new-vmid> --full  # Full clone from template

Container Templates:

pveam update              # Update template list
pveam available           # Show available templates
pveam download local <template-name>  # Download template

Advanced Operations

Snapshots:

qm snapshot <vmid> <snapshot-name>     # Create VM snapshot
qm listsnapshot <vmid>                 # List snapshots
qm rollback <vmid> <snapshot-name>     # Rollback to snapshot
qm delsnapshot <vmid> <snapshot-name>  # Delete snapshot

Configuration Files (if you need to edit directly):

# VM configs are in:
/etc/pve/qemu-server/<vmid>.conf

# Container configs are in:
/etc/pve/lxc/<ctid>.conf

Common Usage Patterns

Daily Operations:

# Check what's running
qm list && pct list

# Quick health check
pvesh get /nodes/$(hostname)/status

# See active tasks
pvesh get /cluster/tasks

Most of these commands require root privileges. You can also use pvesh (Proxmox VE Shell) for API-based operations, which gives you more structured output that's easier to parse in scripts.