difference between send shutdown signal and poweroff the machine in virtualbox

What is the difference between send shutdown signal and Poweroff the machine in Virtualbox ?

Virtualbox

When should I use send shutdown signal option and when should I use Poweroff the machine option ?


Solution 1:

This is directly covered in the documentation:

The difference between the three options is crucial. They mean the following:

  • Save the machine state: […]

  • Send the shutdown signal. This will send an ACPI shutdown signal to the virtual machine, which has the same effect as if you had pressed the power button on a real computer. This should trigger a proper shutdown mechanism from within the VM.

  • Power off the machine: With this option, Oracle VM VirtualBox also stops running the virtual machine, but without saving its state.

    Warning
    This is equivalent to pulling the power plug on a real computer without shutting it down properly. If you start the machine again after powering it off, your OS will have to reboot completely and may begin a lengthy check of its virtual system disks. As a result, this should not normally be done, since it can potentially cause data loss or an inconsistent state of the guest system on disk.

    As an exception, if your virtual machine has any snapshots, see Section 1.10, “Snapshots”, you can use this option to quickly restore the current snapshot of the virtual machine. In that case, powering off the machine will not disrupt its state, but any changes made since that snapshot was taken will be lost.

You almost always want to send shutdown signal, like you almost always want to shutdown a real computer properly instead of just pulling the power plug.

Note if the virtual machine OS can react to ACPI shutdown signal then it can most likely initiate shutdown procedure by itself, from the inside. Like in a physical computer: you click Start, Shut down; or invoke shutdown …; you don't necessarily need to press the power button. One way or another the shutdown is gentle and this is what you usually want.

There are few scenarios in which you may want to power off abruptly (pull the plug):

  1. (mentioned in the citation) When you want to restore a snapshot quickly.
  2. When the OS in the VM is designed to reliably survive pulling the power plug anytime (and maybe even is not able to react to ACPI shutdown signal by design).
  3. When the OS in the VM does not react to ACPI shutdown signal but needs some internal preparations. In such case you should trigger the preparations, wait for a message like "it's now safe to turn off your computer", then pull the plug.
  4. When the VM hangs and resetting or pulling the plug is the only thing you can do.
  5. When you don't care and accept the risk.
  6. When you want to test what bad can happen after pulling the power plug.