basforge

Search titles, text and the “If it doesn’t work” cases.

    RU
    Cheat sheetHomelabProxmox

    Proxmox day to day: qm, pct, pvesm, vzdump and logs

    Commands for the node’s Shell as root. qm manages VMs, pct containers, pvesm storages, vzdump backups; everything the web UI does is available here too. Refer to a guest by number: 101, not by name.

    The host

    Command What it does
    pveversion -v Proxmox package versions and the running kernel
    pvesm status storages: type, used, free
    pveperf a quick CPU benchmark and the disk’s FSYNCS/SECOND
    proxmox-boot-tool kernel list installed kernels and which one will boot
    systemctl status pveproxy pvedaemon pve-cluster the UI, API and /etc/pve services
    pvesh get /nodes/pve1/status the node’s Summary, as text

    VMs

    Command What it does
    qm list all VMs: number, name, state
    qm start 101 start
    qm shutdown 101 shut down through the guest: ACPI or the agent
    qm stop 101 pull the plug
    qm reboot 101 restart, applying pending config changes
    qm config 101 the VM config (Proxmox VM config)
    qm set 101 --memory 4096 change a setting
    qm terminal 101 serial console, exit with Ctrl+O
    qm disk resize 101 scsi0 +10G grow a disk; shrinking isn’t possible
    qm disk move 101 scsi0 local-zfs move a disk to another storage
    qm disk import 101 disk.qcow2 local-lvm a foreign disk into the VM, shows up as Unused
    qm clone 9000 112 --name web2 --full full clone of a template
    qm template 9000 turn a VM into a template, no way back
    qm destroy 101 --purge delete, remove from backups and HA
    qm unlock 101 clear a stuck lock

    Through the guest agent

    Command What it does
    qm guest cmd 101 ping the agent is there — empty output
    qm guest cmd 101 network-get-interfaces the VM’s addresses from inside
    qm guest exec 101 -- df -h / a command in the guest without SSH
    qm guest cmd 101 fsfreeze-status whether the file system is frozen
    qm guest passwd 101 example-user change a user’s password in the guest

    Containers

    Command What it does
    pct list all containers
    pct enter 201 a root shell inside, no network or password
    pct exec 201 -- apt update a command in the container from the host
    pct start 201, pct shutdown 201 start, shut down
    pct config 201 the container config
    pct set 201 -memory 1024 change a setting
    pct resize 201 rootfs +4G grow the root
    pct push 201 ./app.conf /etc/app.conf a file from the host into the container
    pct pull 201 /var/log/syslog ./syslog a file from the container to the host
    pct set 201 -mp0 /srv/share,mp=/srv/share a host directory into the container
    pct unlock 201 clear a stuck lock

    Container templates

    Command What it does
    pveam update refresh the template list
    pveam available --section system systems: Debian, Ubuntu, Alpine…
    pveam download local debian-13-standard_13.6-1_amd64.tar.zst download a template
    pveam list local what’s already downloaded

    Snapshots

    Command What it does
    qm snapshot 101 before-upgrade VM snapshot
    qm snapshot 101 before-upgrade --vmstate 1 snapshot including memory
    qm listsnapshot 101 snapshot tree
    qm rollback 101 before-upgrade roll back to a snapshot
    qm delsnapshot 101 before-upgrade delete a snapshot
    pct snapshot 201 clean the same for a container: pct listsnapshot, pct rollback, pct delsnapshot

    Backups

    Command What it does
    vzdump 101 --storage nas-backup --mode snapshot --compress zstd back up one VM now
    vzdump --all 1 --storage nas-backup back up every guest on the node
    pvesm list nas-backup --content backup copies on the storage
    qmrestore <archive> 901 --unique 1 restore a VM under a new number
    pct restore 902 <archive> --unique 1 restore a container
    pvesh get /cluster/backup backup jobs

    Storage and disks

    Command What it does
    pvesm list local-lvm volumes on a storage: guest disks
    lvs pve/data thin pool usage: Data%, Meta%
    zpool status -x ZFS pools: all pools are healthy or what’s broken
    zfs list -o name,used,avail,compressratio ZFS datasets and compression
    arc_summary -s arc how much memory the ZFS cache has
    smartctl -a /dev/sda disk health and wear
    lsblk -o NAME,SIZE,MODEL,SERIAL disks and their serial numbers

    Network

    Command What it does
    ip -br addr addresses on bridges and cards
    ifreload -a apply /etc/network/interfaces
    bridge link who’s on which bridge
    bridge vlan show VLAN tags on bridge ports
    pve-network-interface-pinning generate pin network card names
    pve-firewall status whether the Proxmox firewall is on

    Updates and logs

    Command What it does
    apt update && apt full-upgrade update the host, not apt upgrade
    pve8to9 --full check before moving from 8 to 9
    journalctl -b -p warning warnings and errors since boot
    journalctl -u pveproxy --since "1 hour ago" the web UI log
    tail -f /var/log/pve/tasks/active tasks running right now
    pvenode task list --limit 20 the node’s latest tasks

    Cluster

    Command What it does
    pvecm status quorum and node votes
    pvecm nodes cluster nodes
    qm migrate 101 pve2 --online a VM to another node without stopping
    pct migrate 201 pve2 --restart a container to another node with a restart