0

I have my Linux installed on a portable SSD, so I can switch devices (laptop at home, desktop in office) easily and don't need to consider any syncronization problems. This is called Linux To Go.

It's quite nice already, but could it be even better?

To switch devices during a work flow, I must exit all applications (gracefully), shutdown the OS completely, then detach and attach the SSD, boot the OS, wait for its powering-up, and last, reopen all the applications needed to resume my work.

Now I want to find a way to achieve "pause and resume" instead of such "stop and restart". I want the OS memory to persist across different devices.

It seems like hibernation is a potential solution. Maybe I could save the memory in a swap partition by hibernating the OS, then detach and attach the SSD, boot the OS, and shortly, the memory is restored so I can continue my work flow.

But after some googling, I can't find any tutorial/blogs about hibernation across multiple devices.

How to hibernate Linux To Go to disk and restore it on a different device? Or, is it simply impossible?

1 Answer 1

1

I don't think hibernation across different devices can possibly work unless the devices are exactly the same in terms of HW configuration (CPU, GPU, RAM, storage, peripherals) and even in this case it's far from certain.

There used to be a project called CryoPID which allowed to save the image of a running application and later resume it however it's long been dead and unmaintained and doesn't work with new Linux kernels. Please check this topic for more possible up to date solutions: https://stackoverflow.com/questions/2134771/how-to-hibernate-a-process-in-linux-by-storing-its-memory-to-disk-and-restorin

To be honest I don't see any modern working solutions in the mentioned topic except using VirtualBox/virtualization to preserve the state of your running applications. That's not quite pleasant to deal with but it works perfectly.

Here's an even better idea: if you have a fast Internet connection you could probably consider having an always on remote PC where you have your workflow and access it using whatever means possible, e.g. RDP/VNC/SSH -x/etc.

2
  • yes even with all the hardware in the exact same configuration it still won't work because those devices will have different IDs and drivers will fail miserably
    – phuclv
    Jun 6, 2022 at 11:09
  • PCI IDs are exactly the same, USB IDs are exactly the same, what's different is MAC addresses and this is solvable: you simply unload the modules responsible for varying devices prior to hibernation (LAN/WiFi/BlueTooth). In case BIOS settings are the same this should work. Jun 6, 2022 at 11:14

You must log in to answer this question.

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