5

Is there a way, on windows 10 and on Linux distributions, to save the machine state before shutting down and load it back up on boot?

I.e. I would like the same feature as in VirtualBox when I use the "save state" to exit a running VM. Which means that when I open back that VM by loading the state, I still have everything just as I left it, and it doesn't take longer than a classical boot.

Is that possible for an OS (not virtualized)?

UPDATE: Of course I would like a real shutdown (does hibernation really shutdown the computer?) to be able to switch OS when booting back up. Use case is: I have a game running on windows, a browser, a bunch of stuff, I shutdown to do some dev on Linux. When I boot I choose Linux instead of Windows, it boots and loads its previous state back (my terminals, with tabs, docker containers still running, my IDE still running etc.). When I'm done with Linux, I shutdown (which saves the state etc.) and reboot under windows which loads back my game, browser etc.

On VirtualBox shutting down is really quick (<10s) and loading the state back up is fairly quick too (~20-40s). This is for a VM using 8GB of RAM. Is there a way to do that with native dual boot OSes and if so, is the speed ok?

Thanks.

0

1 Answer 1

3

Yes that’s what hibernation is. Possible on all major desktop operating systems (Windows, Linux, macOS).

Depending on how much physical memory was in use when shutting down, fully restoring the state might take a lot longer than a regular boot.

You must not change the state of a hibernated system in any way or you’ll cause data corruption, undefined behavior or outright crashes. That generally means no dual booting.

If you really want to, you can of course boot another OS, but it must not touch anything but its own partitions.

To be very clear: Operating systems must use a mutually exclusive set of partitions. There is only one exception: Read-only mounting partitions does not modify them, hence preserving the state the hibernating OS expects.

8
  • I updated my question. Could you check and give more details to as if your answer still fits? Thanks.
    – Hillfias
    Commented Dec 7, 2018 at 12:57
  • Unless you’re very careful, what you want is not possible.
    – Daniel B
    Commented Dec 7, 2018 at 13:03
  • 1
    Yes, that’s basically it. However, depending on the distribution/setup used, it’s very easy to accidentally mount them. ntfs-3g is supposed to refuse, but I wouldn’t rely on that.
    – Daniel B
    Commented Dec 7, 2018 at 13:09
  • 1
    What do you mean by “risk”? You say it’s mounted by both operating systems, that’s not a risk anymore. It’s guaranteed to either fail early or destroy the filesystem later. ;) The solution is not to mount the partition. My answer already says that.
    – Daniel B
    Commented Dec 7, 2018 at 13:54
  • 1
    You can't save the active state of a system, then manipulate that state outside of the system and expect the system to remain stable. Commented Dec 7, 2018 at 17:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .