Fix: can’t lock file ‘/var/lock/qemu-server/lock-VMID.conf’ – got timeout
Another task is holding the VM's local lock file, so a new action timed out waiting for it. Find the running or stuck task, let it finish or stop it, and only then retry.
Not checked by a trusted editor yet Last edited Outdated?
An action on a VM, such as qm stop, a start, a config change or a backup, fails after a while with a message like this (here for VM 104):
can't lock file '/var/lock/qemu-server/lock-104.conf' - got timeout
What it means
Every task that changes a VM first takes a short-lived file lock, /var/lock/qemu-server/lock-<vmid>.conf, on the node. The error says your task waited for that lock and gave up because another process held it the whole time. This is a different mechanism from the lock: line in the VM config (as in “VM is locked (backup)”), so qm unlock usually does not help here.
Likely causes
- Another task on the same VM is still running: a start, shutdown, backup, snapshot or migration. A guest shutdown can wait a long time if the guest OS ignores the request.
- A task is hung, for example a start that waits forever for storage, or an external backup tool’s task that never finished.
- Cluster or storage problems that make operations stall, such as lost quorum or an unreachable network storage.
Fix it step by step
- Look for running tasks for that VM in the task list at the bottom of the web UI, or on the node:
pvenode task list --source active. - If a legitimate task is running (for example a backup or a slow shutdown), wait for it to finish, or stop it from the task viewer if you are sure that is safe. Then retry.
- If no task appears but the error continues, see which process holds the lock file:
fuser -v /var/lock/qemu-server/lock-104.conforlsof /var/lock/qemu-server/lock-104.conf, if those tools are installed, then inspect it withps -fp <PID>. - Check the logs around the time of the stuck task:
journalctl -u pvedaemon --since "1 hour ago". - Check cluster and storage health:
pvecm statusandpvesm status. Fix any lost quorum or inactive storage first. - As a last resort, users report that restarting the API daemon clears stuck worker tasks:
systemctl restart pvedaemon. Running guests keep running, but tasks managed by that daemon are interrupted, so check the task list first.
pvenode task list --source active
fuser -v /var/lock/qemu-server/lock-104.conf
ps -fp <PID>
journalctl -u pvedaemon --since "1 hour ago"
pvecm status
pvesm status
Do not delete lock files by hand. The lock exists to stop two tasks from changing the same VM at once; removing it while a task still runs can corrupt the configuration or disks.
If it keeps coming back
- Look for overlapping schedules, such as backups, snapshots or external tools acting on the same VM at the same time, and spread them out.
- Install and enable the QEMU guest agent so shutdowns and backups complete reliably.
- Investigate slow or unreliable storage, which makes every task take longer and hold the lock longer.
Official documentation
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 · How-to · 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 · How-to · 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 · How-to · Linux Article Clusters & high availability · VMs & containers 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 · Reference · 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 · Reference · Linux Script Shell scripting · VMs & containers 15 Oct 2026
- 0110 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… Beginner · Fix · Linux Article Backup & restore · 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.
- Commitpedia +2,897 chars