Is it safe to save virtual machine state between host reboots if VM uses external drive?
Sebastian Wright
I now use the following setup:
SATA hard drive -> SATA-USB Bridge -> laptop running Ubuntu Host and VirtualBox -> Debian-based network share server (OMV) Guest
External USB drive is passed through to the guest OS automatically. So, when the VM powers on, the USB drive connects to it. When it is powered down, it connects to the host and Ubuntu tries to mount it.
I have set VirtualBox to automatically save state before shutdown of the host and resume after power up of the host. Is it safe to save state of the guest OS when the host laptop is being rebooted? If not, how can it be improved?
1 Answer
Is it safe to save state of the guest OS when the host laptop is being rebooted?
It is not safe only if at least a program in the virtualized OS has write access and is writing the moment you save the state. In any case, I do not recommend using a virtual machine while the host is restarting, because virtualization services depend on many components of the host operating system that could be terminated as the system moves on to the shutdown phase, making the guest less reliable even before its forced termination.
If not, how can it be improved?
Even if virtualization software is stable, it is good practice to do all that is necessary and sacrifice a few seconds of your time to prevent data loss or corruption: if you want to guarantee the integrity of the data on the external mass storage, do the operation of unmount/expulsion from the virtualized OS before saving the state and save the state before the reboot procedure begins.
2