Shutdown VM

taich

Member
Aug 15, 2020
116
18
23
64
After fresh installation of a VM where it does not have installed qemu-guest-agent it is mostly not possible to shutdown or stop the vm from outside the VM. What is the recommended action for this situation?

Thanks
 
Last edited:
Did you enable the guest agent in the VM creation wizard, or in the options before starting the VM?
 
I'm referring again to ticket 2534, just checking if there are any plans to include the already written code to handle this and similar scenarios?
 
In the meantime I created a little bash script <kill-vm>

Bash:
#!/bin/bash
#

if [ $# -lt 1 ] ; then
   echo "Usage: kill-vm <vmid>"
   exit
fi

VMID=${1}

EXIST=`qm list | awk '{print $1}' | grep -c ${VMID}$`
if [ ${EXIST} -eq 1 ]; then
   PID=`ps waux | grep "/usr/bin/kvm" | grep "id ${VMID}" | awk '{print $2}'`
   echo "Kill VMID ${VMID} PID ${PID}"
   kill -9 ${PID}
else
   echo "VMID ${VMID} does not exist or is not runnnig!"
fi
 
Last edited:

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!