Sleeping the host system while running a VM on VirtualBox

5

1

I've been using VirtualBox for a while now, and have always assumed that it must be unsafe, for the VM, to put the host system into sleep or hibernate while said VM is running. However, after learning a bit more about how sleep works, I'm wondering if this is really true.
In summery, is it ever safe to put the host system into sleep while running a VM in VirtualBox? If there are situations where it is indeed unsafe. what are the potential consequences?

DeathByTensors

Posted 2014-08-30T19:12:09.020

Reputation: 173

Answers

1

I have a Windows 7 host. I've run a Windows 7 VM on it in the past, and I currently run a couple of Linux VMs on it. In my experience, it works fine. I've only found two fairly predictable issues:

  1. The guest's clock may be wrong when it wakes back up. I believe the guest additions are supposed to take care of this. I've only noticed it on one of my Linux VMs, which is a pre-built appliance that might not have the guest addtions.

  2. TCP connections between the guest and other hosts may break if the system is offline for a significant length of time.

The worst case would be powering down the host PC while it was asleep. For any guests that are running, it's like being abruptly power-cycled. Modern operating systems and filesystems can generally handle this. But any programs running in the guest would lose their unsaved work, and occasionally you might have other problems.

Kenster

Posted 2014-08-30T19:12:09.020

Reputation: 5 474