1

I've got a KVM guest that won't shut down from virsh or from virt-manager. Most everything I've read says to install ACPI on the guest and do a bunch of configuring on the host to make this work. Is there any reason that I can't halt the guest from a shell running in the guest and then do the "virsh shutdown " command from the server? I want to avoid "virsh destroy" as I understand that "pulling the plug" is a bad idea, i.e. could corrupt the disk.

2
  • 1
    if the VM is halted, it should be safe to virsh destroy it -virsh shutdown won't have any more effect in halted stated than it will in running state. The correct solution is to get ACPI working on the guest, and there's no good reason not to do that.
    – cas
    Commented Jul 21, 2016 at 9:05
  • There is nothing to "configure", just make sure you have the acpi packages installed and enabled inside the guest.
    – dyasny
    Commented Jul 21, 2016 at 13:23

1 Answer 1

1

I'm using debian as KVM guest. It has qemu-guest-agent package that install guest agent without a pain. On the libvirt side I need to add small chunk of xml configuration to enable it:

<channel type='unix'>
  <source mode='bind' path='/var/lib/libvirt/qemu/f16x86_64.agent'/>
  <target type='virtio' name='org.qemu.guest_agent.0'/>
</channel>

From now on you can use virsh shutdown --mode agent to shutdown the guest gracefully

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .