[libvirt-users] Programmatically force shutdown a guest: possible?

Eric Blake eblake at redhat.com
Sat Mar 29 14:12:06 UTC 2014


On 03/29/2014 06:21 AM, Pasquale Dir wrote:
> I am looking at the shutdown method, but if the guest system is a desktop
> system, like for example ubuntu, it just has the effect to show a box
> prompting the user for a shutdown/reboot/ and such.
> 
> I could enter the guest and change this default behaviour and it actually
> works..but I'd like for a way to send a shutdown command without doing so.
> 
> Is it possible?

Guest shutdown is ALWAYS a cooperative action.  It sounds like your
guest defaults to an interactive shutdown when an ACPI shutdown request
is received.  You can install qemu-guest-agent in your guest and send
shutdown via the agent instead of via ACPI - that may be a bit more
responsive at doing an immediate shutdown.  But beyond that, no, there
is no way to guarantee a graceful guest shutdown without guest
cooperation.  If you must stop a guest, and shutdown is taking too long
because the guest is not cooperating, then use the 'virsh destroy' command.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20140329/20b1b29d/attachment.sig>


More information about the libvirt-users mailing list