Cannot shutdown a VM

borpin

New Member
Jun 27, 2020
21
7
3
58
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?
 

gb00s

Member
Aug 4, 2017
28
2
23
42
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:

leesteken

Famous Member
May 31, 2020
1,421
265
83
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.
 

borpin

New Member
Jun 27, 2020
21
7
3
58
Got there in the end.

Fist find out who had the lock
Code:
fuser /var/lock/qemu-server/lock-101.conf
Then kill the process and then stop/shutdown the server.

Thanks for the assist!
 

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 your own in 60 seconds.

Buy now!