[SOLVED] can't shutdown/stop VM

tessus

Active Member
Oct 5, 2020
41
4
28
Toronto, Canada
I am running Virtual Environment 7.3-4. When I start a Linux VM and press ESC in the Grub menu, I can't shutdown the VM.

I only see a spinner in the columns End Time and Status. It never times out. I waited for about 7 minutes. I can only kill the VM by going to the host and kill the kvm process.
Even trying to stop or reset doesn't work anymore.

I think there should be a way to get this VM out of its shutdown spinner situation, but there isn't. Should one ever try to shutdown a VM that doesn't want to be shutdown, it's over.

Is there a way that a configurable timeout could be implemented or anything that would make it possible to interrupt the not-working shutdown?

P.S.: Don't get me wrong, I don't have an issue connecting to the node and kill the kvm process. I am just wondering how one were to handle this in a DC with many, many nodes....
 
Last edited:
Ah, nice. Thank you. I didn't know that I could stop a task in the task log. Not very intuitive. Right click didn't do anything either. But double-click worked.

One can learn something new every day.

I don't really need anything else. This works and I don't have to login to the host and kill the process. But in my setup even that is not an issue. As mentioned before, it would have been a PAIN in a DC with 100 nodes....

Solution: double click the line in the task log that shows the spinner of death..... then click stop.
 
Last edited:
  • Like
Reactions: Neobin
I usually choose to pause the virtual machine first and then click to stop the virtual machine immediately. Usually, I can shut down the virtual machine instantly.
 
This is what I do. I figure out the VM ID first. Then, if shutdown and stop don't work, I open a node shell and type "qm kill 101". And the vm ID 101 stops instantly or about 5 seconds. 101 is the ID for my Linux Mint vm by the way. I have seen where even that doesn't work and I get an error about not being able to lock. So, I then run "qm unlock 101" and then, "qm kill 101" again. Then, it stops running. All in less that 10 seconds. Anyway, that's how I do it when Shutdown and stop do nothing.
 
  • Like
Reactions: paxmobile
This is what I do. I figure out the VM ID first. Then, if shutdown and stop don't work, I open a node shell and type "qm kill 101". And the vm ID 101 stops instantly or about 5 seconds. 101 is the ID for my Linux Mint vm by the way. I have seen where even that doesn't work and I get an error about not being able to lock. So, I then run "qm unlock 101" and then, "qm kill 101" again. Then, it stops running. All in less that 10 seconds. Anyway, that's how I do it when Shutdown and stop do nothing.
I'm having the same problem since a week, should I reinstall Homeassistant and get a new start ? Finding a fix seems too much time consuming for me..
 
Currently, you have to stop the running shutdown task first, before the stop command does/can do anything.
Did/Can you try this?
See also here: [1].

This behavior should change in the (near?) future, since it is already worked on: [2].

[1] https://forum.proxmox.com/threads/stop-vm-impossible.101736
[2] https://bugzilla.proxmox.com/show_bug.cgi?id=4474
Hey!
It is normal for proxmox to be unable to send shutdown/reboot signal to vms, I always had to strait stop my VM because the shutdown/restart command always fails and VM cannot be stopped that way.
What kind of problem may I have encountered?
 
It is normal for proxmox to be unable to send shutdown/reboot signal to vms, I always had to strait stop my VM because the shutdown/restart command always fails and VM cannot be stopped that way.
What kind of problem may I have encountered?
That usually happens when you set QEMU Guest Agent VM setting to enabled but you have not install the QEMU Guest Agent inside the VM.
 
I have a Windows 10 VM and shutdown/restart from PVE works properly.

But on the same PVE, my 2nd Windows 10 VM faces this problem even though agent installed in the VM + setting enabled.

How does one verify the agent is installed properly?
 
same problem with VM's. I've given up, deleted all VMs and now mostly use containers and if I want to shut down the remaining one VM, I have to restart Proxmox to shut down the VM because it doesn't restart (deactivated it) when Proxmox starts.

Only with Ubuntu VMs in Proxmox these problems.
 
Last edited:
Is useful to know that there is a bug where qemu guest agent is enabled in vm configuration but vm don't have qemu system guest agent installed and running shutdown don't work, because don't fallback to ACPI one.
The fix was applied but not released yet and a workaround is to be sure qemu guest agent is installed and running or if not possible install it or have issue disable in vm configuration to have at least ACPI shutdown working.
 
1. Install acpid

Code:
sudo apt update
sudo apt install acpid
sudo systemctl enable acpid
sudo systemctl start acpid

2. Setup ACPI handler to force shutdown

Code:
sudo nano /etc/acpi/events/powerbtn

3. Insert code below in powerbtn file
Code:
event=button/power
action=/sbin/poweroff

4. Restart
Code:
sudo systemctl restart acpid