Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
I don't think there is built-in functionality for this in Windows (certainly not from the GUI at least), as it is counter-intuitive for the 99.9% of users who don't dual boot. If you switch OS's regularly, you might want to consider creating a virtual machine for one of them (using VirtualBox or VMware), then the guest OS can be started/stopped as often as you like, and you can work on both host and guest OS at the same time. –  Spectre May 25 '11 at 15:26
1  
@Spectre: Unfortunately, one of my main reasons for preferring a dual-boot over a VM solution is that I need native 3D graphics performance. I've tried Windows 7 in both VirtualBox and VMware Workstation, but good guest Direct3D support is nonexistent in the former (for DX10+ anyway) and unbearably slow and crashy in the latter (it would seem they got Aero working and left it at that). If VM graphics performance were decent I would switch to a purely VM solution in a snap. –  jgottula May 25 '11 at 19:25
    
Does this mean that you use the Linux OS most of the time? If you use them about equally or could otherwise stand this, why not put Linux in the VM? –  Daniel H May 26 '11 at 21:47
    
You're right, using Windows as the host would get around some of the VM limitations, but I use Linux the vast majority of the time (and I'm probably too much of a Linux snob anyway), so I'm really looking for a primarily-Linux, secondarily-Windows solution. –  jgottula May 27 '11 at 12:01
add comment

2 Answers

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.

share|improve this answer
add comment

If your using linux most of the time, but the work you are doing on it is not intensive, you could use a secondary computer with a KVM switch to switch between the two.

Hibernation (S4) writes the contents of your memory to your harddrive. If power is lost, it can restore itself from the hibernation file. You could always force it to have a power loss, ie disconnect it after it finishes shutting down into hibernation and then choose linux on bootup.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.