qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-discuss] [Qemu-devel] How to stop `qemu-system-x86_64 ...` ins


From: Donald R Laster Jr
Subject: Re: [Qemu-discuss] [Qemu-devel] How to stop `qemu-system-x86_64 ...` instead of `kill -9`?
Date: Thu, 13 Jul 2017 08:15:49 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 SeaMonkey/2.40

Sam,

  I make use of QMP to do the shutdown of the QEMU VMs on Linux.  The RC script 
is what I use to start and stop the VMs I run when starting and stopping the 
systems running the VMs. Look at the function stop_one_qemu_vm in the attached 
RC script and see if that would help do what you want to do.  The file that the 
script reads to start VMs contains command that are simply executed such as:

   /vms/Repositories/Repository/VM_Start.sh
   sleep 60

Each line is the command that is executed.

  Also, if you have VNC capabilities enabled, or another console access method 
such as spice enabled, and you are at the VM's console, you should be able to 
use the command sequence:

   ctrl-alt-shift-2

to get the QEMU command screen at the VM's console (VNC, Spice, etc).  You can 
enter a command such as:

   system_powerdown
   system_wakeup
   system_reset

to stop or reset the VM.  You can use the command sequence:

   ctrl-alt-shift-1

to get back to the VM's console.  I would also use "kill -PWR" before using "kill 
-9" if you need to manually force a shutdown.  Remember the shutdown process will behave just 
like shutting down a physical machine.

  If you can ssh into the VM and become the root user you should be able to 
tell the OS to shutdown with something like:

    /sbin/shutdown -t 5 -P now

for Linux and Unix based VMs.  For Windows you should be able, if you log in as 
an administrator, to do a clean shutdown and power off the system.

  Don

Sam wrote on 07/12/2017 05:24 AM:
hi all,

I'm running `qemu-system-x86_64 ...` to start a guest vm. Now I want to
stop and destroy this vm, I found there is no `qemu-stop` related command,
so I have to `kill -9` this process.

How could I stop `qemu-system-x86_64` instead of `kill -9`? Use `virsh`
command or something?

Thank you~

Attachment: rc.vms
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]