Windows – How to convince Windows 7 to reboot upon hibernating rather than powering down

acpihibernatemulti-bootrebootwindows 7

I have a Linux and Windows 7 dual-boot setup on my PC and I would like to configure the OSes so that when working in one OS, I can hibernate (saving the state to disk), reboot, use the other OS, reboot again when done, and resume using the first OS from where I left off. The critical factor here is that I want each of the OSes to reboot after saving their state to disk instead of powering off; otherwise, I have to turn the computer back on in between which is quite annoying. I'm well aware that it is trivial to configure Linux to do this (see this question). However, I don't know how to tell Windows 7 that I would like it to do the same thing: namely, to reboot the PC after it finishes saving its memory contents to disk instead of powering off like it normally would in a hibernation situation.

Is there any way to do this?

Best Answer

You can't do what you want because Windows always assumes there are no other non-Windows operating systems on your machine.

So long as the Windows bootloader (NTLDR or BOOTMGR, regardless) is installed to the MBR, (re)starting the machine after a hibernation will always resume from the hibernation data on disk and will not prompt you to select an OS to boot from. This is because mounting a volume that was mounted in the hibernated OS from any other OS or environment is undefined behavior. At the best case, when you then attempt to boot into the hibernated OS after mounting one of its volumes in Linux or another Windows install will detect the hibernation data as invalid and refuse to boot from it. In the worst case scenario, it'll boot from the hibernation store and there will be an inconsistent filesystem data in memory vs on disk and your volumes may be corrupted beyond repair (and I speak from experience on this one).

As such, Windows (somewhat rightly) assumes that restarting (instead of shutting down) after a hibernation is pointless, as it would simply result in the machine being in the same state it was before hibernation with nothing achieved and 5 minutes of your time lost.

Now, of course, if a non-BOOTMGR/NTLDR bootloader is installed to the MBR you can accomplish a hibernation of Windows and a boot of a different OS (though you must not modify any volumes that were mounted under the now-hibernated OS or else risk severe data loss). But Windows knows nothing of this (whether or not this is purposely ignored is a topic for another day). So the short answer is that we're trying to do isn't possible without a (para)virtualization environment of some sort.

If you're often switching between OSes and trying to go back to where you were, consider using VMware workstation or even ES(I|X) to boot into multiple OSes at once. Else, a KVM solution like the one @WillGunn suggested isn't a bad option.

Related Question