What is the difference between pause and save state in VirtualBox

Check section 8.13 of the manual you linked for details:

VBoxManage controlvm <vm> pause temporarily puts a virtual machine on hold, without changing its state for good. The VM window will be painted in gray to indicate that the VM is currently paused. (This is equivalent to selecting the "Pause" item in the "Machine" menu of the GUI).

...

VBoxManage controlvm <vm> savestate will save the current state of the VM to disk and then stop the VM. (This is equivalent to selecting the "Close" item in the "Machine" menu of the GUI or pressing the window's close button, and then selecting "Save the machine state" in the dialog.)

Also, you might find the PDF version of the user manual (e.g., for v5.2.18) easier to search through than the paginated HTML version.


Pausing a VM is like minimizing the window of an unsaved file for later, while saving a VM's state is like writing a copy of the file to disk and closing the program.

While a minimized window only uses a token amount of screen space and can't be interacted with until it is restored, the program responsible for it still takes up system resources in the background. Of course, you can still interact with other windows that haven't been minimized.

Likewise, a paused VM ideally uses a negligible amount of processing power, remains unresponsive until it is resumed, and still consumes memory. Other unpaused VMs will still remain interactive. You can also think of pausing a VM as SIGSTOP for a Unix process.

The upside to minimizing a window to free up screen space or pausing the execution of a guest operating system to free up processing power is that both are quick ways to temporarily reclaim a resource, but the downside to both is that unsaved work or the guest state will be lost if the system or host OS goes down. In the event of the latter, the guest OS can become damaged.


On the other hand, after a program saves its file to persistent storage and exits, the file will now remain intact across reboots, and the program now uses zero CPU and memory resources.

Similarly, when a virtual machine saves its state and exits, the same thing basically happens as the state is written to storage and the live resources used by the VM are released. In this scenario, the state of the guest in the virtual machine being saved can be thought of as a modified document that was once in memory and now written to disk.

The advantages to saving a file to disk and closing the program or saving the state of a VM is that both allow data to survive system or host crashes, but the disadvantages to both these scenarios is that reopening a program is slower than restoring a running program's minimized window, as is reloading a VM's state from disk as opposed to resuming its execution when it is already loaded in memory.


Saving a virtual machine writes the entire state of the VM to disk. Which allows you to resume after rebooting, as you mentioned.

You cannot do this while paused. Pausing a virtual machine does nothing more than stop its execution. The CPU stops running commands, reading and writing from memory and disk is stopped. However, all the contents of the VMs memory are in the hosts memory. Rebooting your host computer with a paused VM is no different than just hitting the reset button on a running machine. You run the risk of losing data, or more.

There isnt much of a reason to pause a VM, unless you are trying to temporarily free up the CPU for another task. You could pause a VM before some sort of test, so you can be ready to observe the results. I suppose there are other reasons to pause a VM, but I cant think of good ones.

In the end, if you need to reboot, you should either save the VMs state, or shut it down properly.

Tags:

Virtualbox