Unfortunately, I was disappointed to find `lxd stop --stateful` couldn't save any of my LXD containers. There was always some error or other. This is how I learned about CRIU, as it was due to limitations of CRIU when used with the sorts of things running in LXD.
# lxc stop --stateful test
(00.121636) Error (criu/namespaces.c:423): Can't dump nested uts namespace for 2685261
(00.121645) Error (criu/namespaces.c:682): Can't make utsns id
(00.150794) Error (criu/util.c:631): exited, status=1
(00.190680) Error (criu/util.c:631): exited, status=1
(00.191997) Error (criu/cr-dump.c:1768): Dumping FAILED.
Error: snapshot dump failed
LXD is generally used with "distro-like" containers, like running a small Debian or Ubuntu distro, rather than single-application containers as are used with Docker.It turns out CRIU can't save the state of those types of containers, so in practice `lxd stop --stateful` never worked for me.
I'd have to switch to VMs if I want their state saved across host reboots, but those don't have other behaviours regarding host-guest filesystem sharing that I needed.
In practice this meant I had to live with never rebooting the host. Thankfully Linux just keeps on working for years without a reboot :-)