Proxmox VMs are loc...
 
Share:
Notifications
Clear all

[Solved] Proxmox VMs are locked: How to unlock


Brandon Lee
Posts: 498
Admin
Topic starter
(@brandon-lee)
Member
Joined: 15 years ago

If you have worked with Proxmox, you will note that it is common to see virtual machines that have a "lock" on them, especially if they are being provisioned, restored, or something else. This is usually fine to see this as it means it is locked for a reason to prevent changes being made to the virtual machine when it wouldn't be good or possible to do so. However, I ran into a situation the other day where backups failed to restore, and I couldn't delete the virtual machine out of inventory since it was locked so was in a bit of a catch 22.ย 

Here is how you unlock them if you need to and in a situation like I was in not being able to work with the VM in question when you need to:

Find the VM ID

First, list the virtual machines on your Proxmox node:

qm list

For LXC containers:

pct list

Identify the VM ID of the ghosted or locked VM

Unlock the VM

Try unlocking the virtual machine:

qm unlock <VM_ID>

For LXC containers:

pct unlock <VM_ID>

If it is still locked, check on the lock file manually:

ls -l /var/lock/qemu-server/

If you find a lock file, you can manually remove it:

rm -f /var/lock/qemu-server/lock-<VM_ID>.lock

ย