Fix: TASK ERROR: VM is locked (backup)
A VM or container still carries a backup lock, usually after a backup was interrupted. Check that no backup is running, then remove the stale lock with qm unlock or pct unlock.
Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?
When you try to start, stop, change or back up a guest, the task fails with:
TASK ERROR: VM is locked (backup)
In a backup job log the same problem appears as ERROR: Backup of VM 108 failed - VM is locked (backup). The word in brackets names the operation that set the lock; you may also see (migrate), (snapshot) or (clone).
What the lock means
Backups, snapshots and migrations put a lock: line into the guest’s configuration so that no conflicting action runs at the same time. The lock is removed when the task ends. If the task is interrupted, the lock can stay behind. Common causes, most likely first:
- A backup is still running, for example a long nightly job. Then the error is correct and you only need to wait.
- A backup was stopped or aborted (for example with the Stop button) and left the lock behind.
- The backup target went away or ran full during the backup (NAS rebooted, network storage unreachable, “No space left on device”).
- The node crashed or rebooted during the backup, for example from memory or I/O pressure.
- The guest agent hung while freezing file systems for a snapshot-mode backup.
Fix it step by step
- Confirm the lock and its type:
qm config 108 | grep lock(orpct config 108 | grep lockfor a container). - Make sure no backup is running. Check the task list at the bottom of the web UI, or run
pvenode task list --source activeon the node, and look for avzdumpprocess withps aux | grep [v]zdump. - If a backup is still running, let it finish or stop it from the task viewer, then check whether the lock is gone.
- If no task is running, remove the stale lock on the node that hosts the guest:
qm unlock 108for a VM orpct unlock 108for a container. - Retry the original action, then run a manual backup to confirm backups work again.
qm config 108 | grep lock
pvenode task list --source active
ps aux | grep [v]zdump
qm unlock 108
vzdump 108 --storage nas-backup
Only unlock when you are sure the operation that set the lock is no longer running. Unlocking a guest during an active backup or migration can lead to inconsistent backups or a broken migration.
If unlocking fails
If qm unlock fails with an error about files under /etc/pve, the cluster file system may be read-only, for example because the node lost quorum. Check pvecm status and systemctl status pve-cluster corosync and fix quorum first.
Prevent it from happening again
- Look at the failed backup’s task log to find the real cause: storage errors, timeouts or out-of-space messages.
- Make sure the backup storage has enough free space and use retention (
prune-backups) so old backups are removed. - Avoid aborting running backups unless necessary, and check for leftover locks afterwards (for example with
pvesh get /cluster/resources --type vm, which shows alockfield).
Official documentation
Did this work for you?
No votes yet. Be the first.
If it did not work, the report form below tells the editors what went wrong.
See also
- 0100 Create a VM and a cloud-init template with qm Create KVM virtual machines from the command line with qm, then build a reusable cloud-init template from a cloud image and clone… Intermediate · Step by step · Linux Article Basics · VMs & containers 15 Oct 2026
- 0101 Create LXC containers with pct and pveam Download a container template with pveam, create an unprivileged LXC container with pct, give it a network address and get a shell… Beginner · Step by step · Linux Article VMs & containers 15 Oct 2026
- 0104 Build a Proxmox VE cluster with pvecm and live-migrate VMs Join Proxmox VE nodes into a cluster with pvecm create and pvecm add, check quorum with pvecm status, then move running VMs… Advanced · Step by step · Linux Article Clusters & high availability · VMs & containers 15 Oct 2026
- 0106 Back up and restore guests with vzdump, backup jobs and Proxmox Backup Server Back up Proxmox VE VMs and containers with vzdump, choose a backup mode, schedule backup jobs with retention, restore with qmrestore or… Intermediate · Step by step · Linux Article Backup & restore 15 Oct 2026
- 0107 Proxmox VE command line cheat sheet: qm, pct, pvecm, pvesm and more The Proxmox VE commands you use most: qm for VMs, pct for containers, pvesm for storage, pvecm for the cluster, vzdump for… Intermediate · Cheat sheet · Linux Article Clusters & high availability · VMs & containers 15 Oct 2026
- 0108 List all Proxmox VE guests with status and locks (pvesh + jq) A Bash script that lists every VM and container in the cluster with node, status, lock, memory and uptime, using the Proxmox… Intermediate · Cheat sheet · Linux Script Shell scripting · VMs & containers 15 Oct 2026
Repos in the wild
- proxmox/qemu-server: the Proxmox VE virtual machine manager proxmox/qemu-server Read-only GitHub mirror of qemu-server, the Proxmox VE package that manages QEMU/KVM virtual machines and provides the qm and qmrestore commands. GitHub
History
Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.
- Dominik +2,927 chars