UNDER CONSTRUCTION: Util now this page is just some sort of a collection of notes. — Axel Werner 2024-07-20 08:16
qm list
qm destroy vmId
pvesm status
pvesm list storageId
qm config 666
qm set 666 --memory 1024
qm set 666 --tags dmz,testing,db qm set 666 --tags '' # removes all tags
qm set 666 --nameserver 8.8.8.8,1.1.1.1
qm shutdown 666 # gracefull shutdown (via guest tools) qm shutdown 666 --timeout 60 # with timeout for a hard stop qm stop 666 # hard stop/pull plug/crash qm start 666 qm reboot 666 # gracefully reboot using guest tools qm reboot 666 --timeout 60 # same but with HARD STOP after timeout
qm listsnapshot 666
qm delsnapshot 666 snapshotName
vmid=666 qm listsnapshot "$vmid" |\ grep -v "You are here" |\ awk '{print $2}' |\ xargs -n1 qm delsnapshot "$vmid"
qm snapshot 666 snapshotName
qm shutdown 666 qm snapshot 666 snapshotName qm start 666
qm snapshot 666 snapshotName --vmstate
qm rollback 666 snapshotName qm rollback 666 snapshotName --start # with autostart
qm guest passwd 666 root --password moreThan5Chars
FIXME
FIXME
FIXME
FIXME
FIXME
qm clone existingVmId newVmId \ --name 'newVms.fqdn.lan' \ --storage targetStorageId \ # optional
# define new VM id and your # PVE storage volume # of choice. # vmId=666 pveStorage=local qm stop "$vmId" qm destroy "$vmId" qm create "$vmId" \ --name newHostname.lan \ --description "once uppon a time..." \ --cores 4 \ --memory 2048 \ --cdrom zfsjbod:iso/debian-12.0.0-amd64-netinst.iso \ --virtio0 "$pveStorage":50,backup=1,discard=on,format=qcow2 \ --ciuser root \ --cipassword 12345 \ --ipconfig0 ip=dhcp,ip6=auto \ --net0 virtio,bridge=vmbr0 \ --sshkeys ssh-public-key-file.pub \ --ostype l26 \ --agent 1 \ --citype nocloud \ --ciupgrade 1 \ --serial0 socket \ --storage local \ --tags someTag \ --scsihw virtio-scsi-single \ --bios ovmf \ --efidisk0 "$pveStorage":1 \ --ide0 "$pveStorage":cloudinit,media=cdrom \ # qm status 666
ssh user@newHostname.lan su - # no sudo just yet # enter 'user' password apt update \ && apt install -y \ cloud-init \ qemu-guest-agent echo "PermitRootLogin yes" >>/etc/ssh/sshd_config reboot
FIXME
FIXME
FIXME
FIXME
FIXME