Vhtforums
AI Assistant
Proxmox VMs are loc...
 
Notifications
Clear all

[Solved] Proxmox VMs are locked: How to unlock

1 Posts
1 Users
0 Reactions
3,270 Views
Brandon Lee
Posts: 696
Admin
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@brandon-lee)
Member
Joined: 16 years ago
[#411]

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