Essential commands for managing virtual machines and containers
Proxmox Virtual Environment (Proxmox VE) is an enterprise-grade, open-source virtualization platform that combines two powerful virtualization technologies: KVM (Kernel-based Virtual Machine) for full hardware virtualization and LXC (Linux Containers) for lightweight container-based virtualization.
Proxmox VE transforms standard x86 hardware into a comprehensive virtualization solution with an integrated web-based management interface, making it ideal for building private clouds, running production workloads, and creating flexible test environments. Whether you're managing a single server or orchestrating a multi-node cluster, Proxmox provides enterprise features without the enterprise licensing costs.
Proxmox VE excels at creating resilient, highly-available infrastructure through its advanced clustering capabilities:
With Proxmox clustering, you can build production-grade infrastructure with automatic failover, load balancing, and the ability to perform maintenance on physical hosts without service interruption—all managed through a single, unified interface.
Key Features & Use Cases:
Proxmox VE combines powerful command-line tools with an intuitive web interface, giving you complete control over your virtualization infrastructure. Below you'll find essential CLI commands to manage VMs, containers, storage, networking, and clustering operations.
qm list
qm create 100 --name my-vm --memory 2048 --cores 2 --net0 virtio,bridge=vmbr0
qm start 100
qm stop 100
qm shutdown 100
qm reboot 100
qm destroy 100
qm config 100
qm set 100 --memory 4096
qm set 100 --cores 4
qm set 100 --scsi0 local-lvm:32
qm clone 100 200 --name cloned-vm
qm migrate 100 node2
qm migrate 100 node2 --online
qm terminal 100
qm status 100
pct list
pct create 101 local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst --hostname my-container --memory 1024 --cores 2 --net0 name=eth0,bridge=vmbr0,ip=dhcp
pct start 101
pct stop 101
pct shutdown 101
pct reboot 101
pct destroy 101
pct enter 101
pct exec 101 -- command
pct config 101
pct set 101 --memory 2048
pct clone 101 201 --hostname cloned-container
pct migrate 101 node2
pct push 101 /local/file /container/path
pct pull 101 /container/path /local/destination
qm snapshot 100 snapshot-name
qm listsnapshot 100
qm rollback 100 snapshot-name
qm delsnapshot 100 snapshot-name
pct snapshot 101 snapshot-name
pct rollback 101 snapshot-name
vzdump 100 --mode snapshot --storage backup-storage
vzdump 101 --mode snapshot --storage backup-storage
vzdump --all --mode snapshot --storage backup-storage
qmrestore /path/to/backup.vma.zst 100
pvesm list backup-storage
pvesm status
pvesm add dir backup-storage --path /mnt/backup
pvesm add nfs nfs-storage --server 192.168.1.10 --export /export/path
pvesm remove storage-name
pvesm scan nfs 192.168.1.10
pvesm list storage-name
zpool status
zpool create -o ashift=12 tank mirror /dev/sdb /dev/sdc
cat /etc/network/interfaces
ifreload -a
auto vmbr1
iface vmbr1 inet static
address 10.0.0.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
pve-firewall status
pve-firewall start
qm showcmd 100 | grep -i net
pvecm status
pvecm nodes
pvecm create cluster-name
pvecm add node1-ip-address
pvecm delnode node-name
pvecm expected 1
cat /etc/pve/corosync.conf
qm template 100
qm clone 100 200 --name new-vm --full
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.img
qm importdisk 100 jammy-server-cloudimg-amd64.img local-lvm
qm set 100 --ciuser ubuntu --cipassword password
qm set 100 --sshkey ~/.ssh/id_rsa.pub
qm set 100 --ipconfig0 ip=10.0.0.10/24,gw=10.0.0.1
pveversion
apt update
apt dist-upgrade
pvesh get /nodes/node-name/tasks
pvesh get /nodes/node-name/status
systemctl restart pveproxy
journalctl -u pve-cluster -f
pveam update
pveam available
pveam download local ubuntu-22.04-standard_22.04-1_amd64.tar.zst
ha-manager status
ha-manager add vm:100
ha-manager remove vm:100
ha-manager set vm:100 --state started --max_relocate 2
ha-manager groupconfig
qm help, pct help, or pvesh help for more detailed information about specific commands. Access the web interface at https://your-proxmox-ip:8006 for GUI-based management.