Cannot shutdown a VM

borpin

Member
Jun 27, 2020
23
18
8
60
I cannot force a VM to shutdown - I need to simply pull the plug.

I continually get

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

How can I kill the process?
 
  • Like
Reactions: melroy89
qm stop <VM Number> && qm shutdown <VM Number>

I hope it works for you. I sometimes have the same problem. My experience is you have at least one time to wait until the vm goes down by itself. Otherwise the issue won't be ever solved. Then shut it down and it should fix it. I believe a systemd issue.
 
Last edited:
I wonder what the VM is locked for? It might tell in the /etc/pve/qemu-server/${VMID}.conf file. Shutdown already running, or maybe backup?
qm stop is the equivalent of pulling the plug, but if a qm shutdown is already running, it will give a timeout and you have to cancel the shutdown first.
qm list will show you the PID of the kvm-process that runs for your VM. You might try a kill if all else fails, which is like unplugging the virtual CPU.
 
I think it would be nicer that Proxmox automatically kills the hanging "shutdown", removing the lock and allowing the proceed with the "stop" command instead!
The Proxmox team already said they will have a look at it and see if then implement that.
 
  • Like
Reactions: melroy89

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!