Home » How to Fix 'VM is locked (backup/snapshot)' Error in Proxmox VE
Systems & Servers

How to Fix 'VM is locked (backup/snapshot)' Error in Proxmox VE

The error TASK ERROR: can't lock file '/var/lock/qemu-server/lock-XXX.conf' - got timeout or the persistent notification VM is locked (backup) / VM is locked (snapshot) in the Proxmox Virtual Environment (PVE) web console occurs when an automated or manual maintenance task terminates abnormally before releasing the internal safety lock.

Proxmox automatically places safety locks on QEMU virtual machines and LXC containers during critical operations such as live backups via Proxmox Backup Server (PBS), snapshot creations, or cross-node migrations to prevent concurrent disk writes and filesystem corruption. If the target backup storage encounters a network timeout or the job is forcefully killed, this administrative lock remains active indefinitely, preventing administrators from starting, stopping, or configuring the instance from the web interface.

Quick Diagnostics

Root Cause
Interrupted backup job due to network drop or reboot (locked: backup)
Recommended Fix
Release the safety lock from the node terminal using qm unlock <vmid>
Root Cause
LXC container stuck after an ungraceful snapshot (locked: snapshot)
Recommended Fix
Clear container lock state via CLI with pct unlock <vmid>
Root Cause
Dangling vzdump background process holding the lock file
Recommended Fix
Identify and kill the dead background backup task before unlocking
Root Cause
Slow network storage (NFS/SMB) creating I/O backup timeouts
Recommended Fix
Review storage latency and implement I/O bandwidth limits in backup jobs

Step-by-Step Solution

  1. 1

    Step 1: Check for and terminate orphaned backup processes

    Before forcibly releasing the lock, make sure no background worker process is actively streaming data to or from the virtual disk. Access the Proxmox node shell over SSH or via the Web GUI console and list all running jobs associated with your VM ID:

    BASH
    # Replace 105 with your specific VMID
    ps aux | grep qm | grep 105
    ps aux | grep vzdump
    

    If an inactive or hung vzdump process is still lingering in the process table with no I/O progression, terminate it:

    BASH
    kill -9 <PROCESS_PID>
    
  2. 2

    Step 2: Release virtual machine locks using qm unlock

    For KVM/QEMU virtual machines, invoke the native Proxmox qm unlock CLI utility:

    BASH
    qm unlock 105
    

    Once executed, refresh the Proxmox Web GUI. The yellow padlock icon will immediately vanish, and power actions (Start, Shutdown, Reboot) will be restored.

  3. 3

    Step 3: Unlock LXC containers using pct unlock

    If the locked instance is an LXC container rather than a full virtual machine, use the pct management command:

    BASH
    pct unlock 200
    

    Confirm the container has returned to an operational state:

    BASH
    pct status 200
    
  4. 4

    Step 4: Manually clear persistent locks from configuration files

    In rare scenarios where the unlock command returns no errors but the GUI still indicates that the instance is locked, manually inspect the configuration file:

    BASH
    # For QEMU Virtual Machines:
    nano /etc/pve/qemu-server/105.conf
    
    # For LXC Containers:
    nano /etc/pve/lxc/200.conf
    

    Locate the line beginning with lock: (such as lock: backup or lock: snapshot), delete that line completely, save with Ctrl + O, and exit with Ctrl + X. The Proxmox cluster filesystem (pmxcfs) automatically syncs the edit across the cluster in real time.

Frequently Asked Questions

Is it safe to run qm unlock while a virtual machine is running?

Yes. The qm unlock command strictly removes Proxmox's metadata lock flag. However, ensure no background backup is actively transferring disk blocks to avoid producing a partially corrupt backup file.

Why does Proxmox lack an unlock button in the web GUI?

This design choice is intentional. Forcing administrators to access the shell ensures that hung processes are manually reviewed before releasing the safeguard, preventing accidental dual-write scenarios on virtual disks.

Prevention Advice

Recommended security practices:

  • Configure backup bandwidth limits (BW Limit): In Datacenter -> Backup, set an appropriate bandwidth throttling limit to avoid overwhelming network throughput on shared NFS or TrueNAS targets.
  • Avoid hard task cancellations: Never hit the forced "Stop" button in the task log window while a ZFS or LVM disk snapshot is underway; allow I/O queues to drain naturally.
  • Health-check storage targets: Ensure all mounted backup targets have reliable connectivity and adequate capacity before scheduling large recurring nightly backups.
Author • Web Designer & App Creator

Rodolfo Castro

Web designer, app developer, and founder of SoporteCero. Specializing in UI/UX architecture, digital products, and modern web environments (Pixel Digital Dz). Every tutorial and guide on SoporteCero is thoroughly tested and verified in our technical lab to ensure reliable, up-to-date solutions.