Does VirtualBox support hibernation in the guest OS?

10

3

Currently I am experimenting with hiberfil.sys file on Windows 7 and to not break my major system, I decided to install Windows 7 in VirtualBox. As turned out, hibernation is disabled and cannot be enabled in guest system; it says that hibernation is not supported by hardware or something like that.

Has anybody met this problem before? Any way to enable hibernation in VirtualBox?

Signum

Posted 2014-05-07T16:37:13.197

Reputation: 201

why would you want to hibernate a virtual machine? – Keltari – 2015-10-03T04:36:49.133

As I said - I was experimenting with hiberfil.sys (wanted to move this file to another drive, but as turned out, it's probably impossible). – Signum – 2015-10-03T07:38:34.673

Hibernation is supported by hardware. Its unlikely this is something that would be virtualized. – Ramhound – 2014-05-07T17:59:40.453

@Ramhound: Not necessarily. I think in the APM days the BIOS used to do most of the work, but nowadays, the important part – saving/restoring the RAM image – is implemented by Windows NT and Linux entirely within the OS. I don't think there are major differences between going to S4 (Suspend to Disk) vs just powering off the computer. – user1686 – 2014-05-07T19:37:09.680

Answers

10

VirtualBox, unfortunately, does not support features that would allow guest OS to sleep or hibernate. So there is no way to enable hibernation in the guest Windows system.

But unless you specifically need to use the hibernation in the guest system (e.g. for testing), there's really no need for that as VirtualBox itself has the similar feature. Read below for details.


If someone is looking for the same effect but without the need to actually use the Windows hibernation, VirtualBox has a feature called Save the machine state. It simply freezes the guest system and saves RAM and VM state to the disk. It's done by VirtualBox, not Windows. When the guest system is started again and its state is restored, it won't even notice it has been interrupted.

You can trigger it by simply clicking on VM window's close button, selecting Save the machine state and confirming with OK. Or open VM's context menu in VirtualBox, open Close submenu and select Save state. It has also keyboard shortcut, in VirtualBox window it's Ctrl + V and in VM's window it's Host key + Q.

This should work with any guest system theoretically, even if it itself doesn't support the hibernation.

You can also check the section 1.8.6. Saving the state of the machine of VirtualBox's user manual.

Dawid Ferenczy Rogožan

Posted 2014-05-07T16:37:13.197

Reputation: 346

3This doesn’t answer the question. The original poster clearly states, “Currently I am experimenting with hiberfil.sys file on Windows 7 and to not break my major system, I decided to install Windows 7 in VirtualBox.” So the original poster does not seek to save a machine’s state as much as they wish to experiment with tweaking the hiberfil.sys file on Windows 7 running in a Virtual Machine so as not to blow up their main Windows 7 machine. – JakeGould – 2015-10-03T03:05:50.817

@JakeGould I don't think so. The question is "Any way to enable hibernation in VirtualBox?" and my answer "VirtualBox does not support features that would allow guest OS to sleep or hibernate.". It perfectly answers the question. I don't think it's bad to add other information since it can help others. I ended on this question when I was searching for "Hibernation in Windows 7 guest in VirtualBox". – Dawid Ferenczy Rogožan – 2015-10-03T03:11:58.233

See my comment above, I have explained why I care about hiberfil.sys and not saving machine state. – Signum – 2015-10-03T07:41:05.407

1@Signum But you got an answer. It's simply not possible. I put a delimiter between the answer to your question and general answer, so it should be more clear. You shouldn't think about yourself only. I would say that 99 % people who will end here actually don't care about Windows hibernation, they just want to hibernate anyhow. And I don't care about down-votes, if it will help even to single other person, I'll be satisfied. That's the main purpose of this site - to help others. – Dawid Ferenczy Rogožan – 2015-10-04T03:13:41.687

2That's pretty sad if VirtualBox does not support that. For example, I wanted to test application behavior when receiving WM_POWERBROADCAST message (for capturing sleep/resume events) on different Windows versions...That would be useful. – Vincas Dargis – 2016-12-21T13:10:58.280