[CRIU] CRIU with GNU Screen: dumping and restoring entire process trees under Screen

Nikhil Nair nnair at pobox.com
Fri Apr 17 13:02:45 MSK 2020


Hi,

I'm completely new to CRIU, and it sounds very interesting.

On the website, I found a page about using CRIU to dump and restore entire
process trees under screen, but it seems the page is empty, and has been so
for 3 years.

I'm hopeful, though, that the existence of that page means this is very
doable indeed.  Is that right?  I've searched the archive of this list for
an answer to this, as well as Googling it, but couldn't find anything.

Ideally, I'd like to be able to have a script running in the background
which will take a snapshot of my screen session (which typically has one
Emacs session running within it, plus a number of bash shells with
different CWDs and screen contents) every several minutes (and then delete
old snapshots so that it only keeps the last few at any time).  I presume
taking a snapshot will involve both a CRIU dump and taking a copy of my
relevant working directories.

The reason I'm looking at this is that I'm shifting to develop on Windows
10 using their Windows Subsystem for Linux (WSL), running Ubuntu.  It's
pretty much binary compatible with Ubuntu running on a normal AMD64
platform with a text console (I'm not using X).

The issue is that, sometimes, the host Windows machine reboots, without
always asking my permission - or, at least, only waiting so long, so if I'm
away from the machine, I could come back to find the machine rebooted, and
my screen session lost.  There are things I can do to make reboots less
likely, but I don't trust Windows not to reboot if it considers it
important, without giving me a chance to save my work.

But honestly, even if I did have a chance to save my work, taking a
snapshot would be much easier than setting up the screen session from
scratch, anyway.

So... what's the situation?  Is this reasonably straightforward?

If the above won't work, I could look into using lxc under WSL, and
snapshot the container; but that seems overkill, for what I'm after.
Docker would have been an option, but I gather (from the CRIU website) that
dumping an interactive container isn't yet enabled in Docker.

Cheers,

Nikhil.


More information about the CRIU mailing list