Proxmox Command Cheat Sheet - VM & Container Management

Comprehensive Proxmox command cheat sheet for managing VMs and containers. Includes commands for VM creation, start, stop, snapshot, disk operations, and container management.

Proxmox Command Reference

Proxmox VM Management Commands

Command Command Description
qm list List all virtual machines.
qm create <vm> Create a new virtual machine or restore from backup.
qm start <vm> Start a virtual machine.
qm suspend <vm> Suspend a virtual machine's operation.
qm shutdown <vm> Gracefully shut down a virtual machine.
qm reboot <vm> Reboot a virtual machine.
qm reset <vm> Reset a virtual machine.
qm stop <vm> Stop a virtual machine forcefully.
qm destroy <vm> Delete a virtual machine and all its associated volumes.
qm monitor <vm> Enter the QEMU Monitor interface for advanced control.
qm pending <vm> View pending configuration changes for a virtual machine.
qm sendkey <vm> <key_event> Send a key event to a virtual machine.
qm showcmd <vm> Display the command line used to start the VM for debugging.
qm unlock <vm> Unlock a virtual machine that may be locked.
qm clone <vm> <new_vm> Create a clone of an existing virtual machine.
qm migrate <vm> <node> Migrate a virtual machine to another Proxmox node.
qm status <vm> Display the current status of a virtual machine.
qm template <vm> Convert a virtual machine into a template.
qm set <vm> Modify virtual machine configuration options.

Proxmox Cloud-init Management

Command Command Description
qm cloudinit dump <vm> <type> Retrieve automatically generated cloud-init configuration.
qm cloudinit pending <vm> View pending cloud-init configuration for a VM.
qm cloudinit update <vm> Regenerate and update the cloud-init configuration drive.

Proxmox VM Disk Management

Command Command Description
qm disk import <vm> <source> <storage> Import an external disk image as a new disk for a VM.
qm disk move <vm> <disk> Move a VM disk to different storage or to another VM.
qm disk rescan Rescan all storage devices to update disk information.
qm disk resize <vm> <disk> <size> Extend the size of a virtual machine's disk.
qm disk unlink <vm> --IDLIST <string> Unlink and delete specified disk images for a VM.
qm rescan Rescan volumes to update their status and information.
qemu-img convert <qcow2> <raw> Convert a QCOW2 disk image to RAW format.
qemu-img convert -p -O qcow2 <raw> <qcow2> Convert a RAW disk image back to QCOW2 format.

Proxmox VM Snapshot Management

Command Command Description
qm listsnapshot <vm> List all available snapshots for a virtual machine.
qm snapshot <vm> <snapshot> Create a snapshot of a virtual machine.
qm delsnapshot <vm> <snapshot> Delete a specific snapshot of a virtual machine.
qm rollback <vm> <snapshot> Rollback a virtual machine to a previous snapshot state.
qm terminal <vm> Open a serial console terminal for a virtual machine.
qm vncproxy <vm> Proxy VM VNC traffic for remote access.

Proxmox Miscellaneous VM Commands

Command Command Description
qm guest cmd <vm> <command> Execute QEMU Guest Agent commands within a VM.
qm guest exec <vm> Execute a command inside a VM via the guest agent.
qm guest exec-status <vm> <pid> Get the status of a process started by the guest agent.
qm guest passwd <vm> <user> Set the password for a specified user within a VM.

Proxmox Storage and Volume Management

PV, VG, LV Management

Command Command Description
pvcreate <disk> Initialize a disk as a Physical Volume (PV).
pvremove <disk> Remove a Physical Volume (PV) from LVM.
pvs List all Physical Volumes (PVs).
vgcreate <vg> <disk> Create a new Volume Group (VG) with specified PVs.
vgremove <vg> Remove a Volume Group (VG).
vgs List all Volume Groups (VGs).
lvcreate -L LV-SIZE -n <lv> <vg> Create a Logical Volume (LV) with a specified size.
lvremove <vg>/<lv> Remove a Logical Volume (LV).
lvs List all Logical Volumes (LVs).

Proxmox Storage Management

Command Command Description
pvesm add TYPE <storage> Add a new storage configuration.
pvesm alloc <storage> <vm> <file> <size> Allocate disk space on a storage for a VM.
pvesm free <volume> Delete a storage volume.
pvesm remove <storage> Remove a storage configuration.
pvesm list <storage> List the contents of a specific storage.
pvesm lvmscan Scan for local LVM volume groups.
pvesm lvmthinscan Scan for local LVM Thin Pools.
pvesm scan lvm List local LVM volume groups.
pvesm scan lvmthin VG List local LVM Thin Pools.
pvesm status Get the status of all datastores.

Proxmox Template Management

Command Command Description
pveam available List all available appliance templates.
pveam list <storage> List templates available on a specific storage.
pveam download <storage> <template> Download appliance templates to a storage.
pveam remove <template> Remove a template from storage.
pveam update Update the container template database.

Proxmox Container Management Commands

Command Command Description
pct list List all containers.
pct create <vm> OSTEMPLATE Create a new container from an OS template.
pct start <vm> Start a container.
pct clone <vm> <new_vm> Create a clone of an existing container.
pct suspend <vm> Suspend a container's operation (experimental).
pct resume <vm> Resume a suspended container.
pct stop <vm> Stop a container abruptly.
pct shutdown <vm> Gracefully shut down a container.
pct destroy <vm> Delete a container and all its associated files.
pct status <vm> Display the current status of a container.
pct migrate <vm> <target> Migrate a container to another Proxmox node.
pct config <vm> Get the configuration of a container.
pct cpusets Print the list of assigned CPU sets for containers.
pct pending <vm> View pending configuration changes for a container.
pct reboot <vm> Reboot a container by stopping and starting it.
pct restore <vm> <template> Restore a container from a template or backup.
pct set <vm> Modify container configuration options.
pct template <vm> Convert a container into a template.
pct unlock <vm> Unlock a container that may be locked.

Proxmox Container Disk Management

Command Command Description
pct df <vm> Get the container’s current disk usage.
pct fsck <vm> Run a filesystem check (fsck) on a container volume.
pct fstrim <vm> Run fstrim on a container and its mount points.
pct mount <vm> Mount the container’s filesystem on the host.
pct move-volume <vm> <volume> Move a rootfs or mountpoint volume to different storage.
pct unmount <vm> Unmount the container’s filesystem.
pct resize <vm> <disk> <size> Resize a container mount point.
pct rescan Rescan all storages to update disk sizes.
pct enter <vm> Connect to a container's shell.
pct console <vm> Launch a console for the specified container.
pct exec <vm> Launch a command inside the specified container.
pct pull <vm> <source> <destination> Copy a file from the container to the local system.
pct push <vm> <source> <destination> Copy a local file to the container.

Proxmox Web GUI Management

Command Command Description
service pveproxy restart Restart the Proxmox web interface service.