Unlock VM in Proxmox

Today I created a new VM in Proxmox, but I made a mistake and so I wanted it to powerdown and then delete it. So I type in the console of the VM the command: sudo halt
The server indicates that it is going to the halt state and I then want to shut down the server completely in the GUI via the Stop command and then remove it, but no matter what I try, nothing works. In the logging I suddenly saw the message below.

trying to acquire lock...
TASK ERROR: can't lock file '/var/lock/qemu-server/lock-103.conf' - got timeout

So I went looking for where this is coming from and one reason is that for example there is a backup process going on right at that moment, preventing it from getting a lock and powerdown on the VM. You can solve this in the following way.

Log into the host server's CLI and then enter the following command to get the PID of the correct server. You can also see this via the GUI.

cat /etc/pve/.vmlist

If we got the correct PID from the VM then run the command below and then the lock is removed.

qm unlock <VMID>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.