๐Ÿ–ฅ๏ธ Proxmox Homelab

Code snippets, config tips, lessons learned โ€” straight from my basement cluster.

ALL
NETWORKING
STORAGE
LXC
VMs
BACKUP
SCRIPTING
CLUSTER
CLUSTER ONLINE
3 Nodes ยท 14 VMs ยท 8 LXC
create-cluster.sh
BASHCLUSTER
Initialize a new Proxmox cluster and join secondary nodes. Run on node1 first, then the join command on each additional node.
# On node1 โ€” create the cluster
pvecm create hornt3ch-cluster

# Verify cluster status
pvecm status

# On node2/node3 โ€” join the cluster (replace IP with node1's IP)
pvecm add 192.168.1.10

# Check all nodes are visible
pvecm nodes
bulk-snapshot.sh
BASHVMSCRIPTING
Snapshot all running VMs at once โ€” useful before a Proxmox update or config change. Includes timestamp in snapshot name.
#!/bin/bash
SNAPNAME="pre-update-$(date +%Y%m%d-%H%M)"

for VMID in $(qm list | awk 'NR>1 && $3=="running" {print $1}'); do
  echo "Snapping VM $VMID โ†’ $SNAPNAME"
  qm snapshot $VMID $SNAPNAME --description "Auto pre-update snapshot"
done

echo "Done. List snapshots with: qm listsnapshot <vmid>"
create-lxc-debian.sh
BASHLXC
Spin up a lightweight Debian 12 LXC container via CLI. Adjust VMID, IP, and storage to match your setup.
pct create 101 \
  local:vztmpl/debian-12-standard_12.7-1_amd64.tar.zst \
  --hostname debian-lab \
  --memory 1024 \
  --cores 2 \
  --rootfs local-lvm:8 \
  --net0 name=eth0,bridge=vmbr0,ip=192.168.1.101/24,gw=192.168.1.1 \
  --unprivileged 1 \
  --start 1

# Attach to the container
pct enter 101
vzdump-backup.sh
BASHBACKUP
Run a manual vzdump backup of specific VMs to NFS storage with compression.
# Backup VMs 100, 101, 102 to NFS share
vzdump 100 101 102 \
  --mode snapshot \
  --compress zstd \
  --storage nfs-backup \
  --mailnotification failure

# Or backup ALL VMs on this node
vzdump --all \
  --mode snapshot \
  --compress zstd \
  --storage nfs-backup \
  --exclude 999  # exclude template VM
zfs-pool-setup.sh
BASHSTORAGE
Create a ZFS mirror pool from two drives and add it to Proxmox storage.
# Check disk names first
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT

# Create ZFS mirror (RAID-1 equivalent)
zpool create -f tank mirror /dev/sdb /dev/sdc

# Verify
zpool status tank

# Add to Proxmox via CLI
pvesm add zfspool zfs-tank \
  --pool tank \
  --content rootdir,images

# Enable compression (always do this)
zfs set compression=lz4 tank
โœ…
Always snapshot before updates
Before running apt upgrade or a Proxmox version bump, snapshot your critical VMs. Takes 30 seconds and has saved me hours of recovery time. Use qm snapshot <vmid> pre-update from the shell.
โš ๏ธ
Disable the Enterprise Repo if you're not subscribed
Fresh Proxmox installs point at the enterprise repo. Comment it out in /etc/apt/sources.list.d/pve-enterprise.list and add the free no-subscription repo instead. Otherwise apt update will fail every time.
๐Ÿ’ก
Use VLAN-aware bridges for network segmentation
Enable VLAN-aware on vmbr0, then assign VLAN tags per VM/LXC NIC. Much cleaner than creating separate bridges for each network. Works great for separating IoT, trusted LAN, and lab traffic on a single physical NIC.
๐Ÿ”ง
Use virtio drivers for Windows VMs
Always install virtio-win drivers in Windows VMs. VirtIO disks and NICs are dramatically faster than the emulated defaults. Download the ISO from fedorapeople.org/groups/virt/virtio-win/ and attach it as a second CD-ROM during install.
โš ๏ธ
Don't store VMs on local (ext4) โ€” use LVM-thin or ZFS
The default local storage is fine for ISOs and backups, but for VM disks use local-lvm or a ZFS pool. You get thin provisioning, working snapshots, and much better performance.
๐Ÿš€
Enable CPU host passthrough for performance
Set CPU type to host on VMs that don't need live migration. You get the full native CPU feature set โ€” matters for gaming VMs or compilation workloads. Note: can't live-migrate these VMs across different CPU generations.
๐Ÿ“Š
Use Proxmox's built-in InfluxDB + Grafana metrics export
Datacenter โ†’ Metric Server โ†’ Add InfluxDB. Pair with a Grafana LXC for real-time dashboards across all nodes and VMs. Way easier than rolling your own collectd setup.
๐Ÿ”ด
NEVER run apt dist-upgrade on a running cluster node without a plan
Proxmox version upgrades require careful prep: drain the node, check the upgrade guide, snapshot everything, and have a console fallback. SSH dying mid-upgrade while you're remote is not a fun evening.