qemu picture

vmdown(1) man page


vmdownshutdown a Qemu virtual machine


vmdown [-kstw] [vmhome_path …]

vmdown [-kstw] -a

vmdown [-kstw] -p pid …


Shutdown selected virtual machines using the selected method.
See OPTIONS below for more details on the virtual machines and shutdown methods selection.


Virtual machines selection options

The virtual machines selection options are as follows:
Shutdown all running virtual machines.
-p pid …
Shutdown the virtual machine running with the PID pid.
The default is to shutdown the virtual machine designated by the home directory vmhome_path. If no home directory is provided, the current working directory is used.

Shutdown methods selection options

The shutdown methods selection options are as follows:
Kill the virtual machine process (send a SIGKILL to the Qemu process).
This is the most brutal way to shutdown a virtual machine. The host operating system immediatly terminates the Qemu hypervisor process. It should only be used against stuck Qemu hypervisor processes.
Send an ACPI shutdown request to the virtual machine guest.
This is cleanest way to shutdown a virtual machine as it allows the guest operating system and the application it runs to gracefully close themselves. However, the guest operating system must be able to handle ACPI events for this method to have any effect. In particular, this won’t work against legacy or stuck guest operating systems.
Terminate the virtual machine process (send a SIGTERM to the Qemu process).
The Qemu hypervisor process immediatly terminates the guest operating system, but will still ensure that from the hypervisor side all pending data gets correclly flushed and all opened resources gets closed correctly.
This shutdown method however leaves no way for the guest’s operating system and application to save their data, it should be used only against either legacy and stucked guests which do not respond to ACPI shutdown requests, or against stateless guests (vitual machines in read-only or snapshot mode).
The default is to try every shutdown method (equivalent to -kst).
When several methods are selected, -w is assumed and the methods are always processed in the following order, independantly of the flags order in the command-line:
  1. If -s is enabled, send an ACPI shutdown request to the guests of all selected processes.
  2. If -t is enabled, send a SIGTERM signal to the selected processes still running.
  3. If -k is enabled, send a SIGKILL signal to the selected processes still running.

Other options

The other options are as follows:
Show usage information summary then exit.
Decrease verbosity. Add several -q options to decrease verbosity even more (-qq by default to get minimal output). See vmtools.conf(5) for more information about verbosity levels.
See -v to increase the verbosity level.
Increase verbosity. Add several -v options to increase verbosity even more (-vvv by default to get the most verbose output, including debugging messages). See vmtools.conf(5) for more information about verbosity levels.
See -q to decrease the verbosity level.
Wait for the virtual machine to terminate before proceeding. The wait ends when all selected virtual machines have stopped or after the vm_qemu_shutdown_timeout timer expired (20 seconds by default, see vmtools.conf(5)), whichever happens first.
This flag is automatically enabled when several shutdown methods are selected. In this case vmdown waits between each selected shutdown method and after the last one.


Default location to store temporary files, by default /tmp.
Location of user’s configuration files, by default ~/.config.


Libraries shared by the vmtools project utilities.
Virtual machine default settings, see vmtools.conf(5).
Moreover, the content of /usr/local/share/vmtools can be overridden in the following locations (in the order of precedence):
User overrides (if cfg_include_userhome is set to “yes”).
System-wide overrides.


Success: all selected virtual machines have been shut down.
An error occurred, more information is available on the error output.
Wrong usage, nothing has been done.
Partial success: some virtual machines may have been shutdown.


Example 1:
Shutdown the current virtual machine:
cd ~/my-vm 
Example 2:
Shutdown all running virtual machines (particularly useful in a system shutdown script):
vmdown -a
Example 3:
Quickly stop the virtual machine bearing a certain PID:
vmdown -tk -p 1234


The ACPI-based guest shutdown requires socat(1) to be available on the host system and the virtual machine to have a monitor file (the virtual machine typically needs a home directory for this). This functionality will not work and will raise an appropriate warning message if these prerequisites are not fulfilled (witout impact on any other shutdown method selected).
This limitation is not very damaging as it mostly affects HDD-less guests started from live-CDs, which usually do not mind being brutally shut down anyway.
This limitation is caused by Qemu. A feature request has been opened upstream.


Please send bug reports to the vmtools issues page.

Popular tags see all