Criu missing error while taking snapshot

Hi,
I installed lxd using snap and facing issue while taking stateful snapshot Please help me how to resolve this.

root@colin-GL503VM:~# lxc list
±----------------±--------±-------------------±-----±-----------±----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
±----------------±--------±-------------------±-----±-----------±----------+
| desired-chigger | RUNNING | 10.98.59.18 (eth0) | | PERSISTENT | 0 |
±----------------±--------±-------------------±-----±-----------±----------+

root@colin-GL503VM:~# lxc snapshot desired-chigger snap1 --stateful
Error: Unable to create a stateful snapshot. CRIU isn’t installed

root@colin-GL503VM:~# criu
Usage:
criu dump|pre-dump -t PID []
criu restore []
criu check [–feature FEAT]
criu exec -p PID
criu page-server
criu service []
criu dedup

Commands:
dump checkpoint a process/tree identified by pid
pre-dump pre-dump task(s) minimizing their frozen time
restore restore a process/tree
check checks whether the kernel support is up-to-date
exec execute a system call by other task
page-server launch page server
service launch service
dedup remove duplicates in memory dump
cpuinfo dump writes cpu information into image file
cpuinfo check validates cpu information read from image file

Try -h|–help for more info
root@colin-GL503VM:~# lxc config show
config: {}
root@colin-GL503VM:~# lxc network show lxdbr0
config:
ipv4.address: 10.98.59.1/24
ipv4.nat: “true”
ipv6.address: none
description: “”
name: lxdbr0
type: bridge
used_by:

  • /1.0/containers/desired-chigger
    managed: true
    status: Created
    locations:
  • none
    root@colin-GL503VM:~# lxc storage show default
    config:
    source: /var/snap/lxd/common/lxd/storage-pools/default
    description: “”
    name: default
    driver: dir
    used_by:
  • /1.0/containers/desired-chigger
  • /1.0/profiles/default
    status: Created
    locations:
  • none
    root@colin-GL503VM:~# lxc profile show default
    config: {}
    description: Default LXD profile
    devices:
    eth0:
    name: eth0
    nictype: bridged
    parent: lxdbr0
    type: nic
    root:
    path: /
    pool: default
    type: disk
    name: default
    used_by:
  • /1.0/containers/desired-chigger

An Update

Found some information on CRIU on the compare page of LXD vs LXC and tried it also.

root@colin-GL503VM:~# snap set lxd criu.enable=true
root@colin-GL503VM:~# systemctl reload snap.lxd.daemon
root@colin-GL503VM:~#
root@colin-GL503VM:~#
root@colin-GL503VM:~#
root@colin-GL503VM:~# lxc snapshot desired-chigger snap1 --stateful
Error: snapshot dump failed
(00.000021) Warn (criu/log.c:203): The early log isn’t empty
(00.061961) Warn (criu/net.c:2910): Unable to get tun network namespace
(00.358606) Warn (criu/image.c:134): Failed to open parent directory
(00.362753) Error (criu/sk-netlink.c:77): netlink: The socket has data to read
(00.362787) Error (criu/cr-dump.c:1344): Dump files (pid: 2709) failed with -1
(00.365225) Error (criu/cr-dump.c:1742): Dumping FAILED.

Please guide me to take stateful snapshot

That’s a CRIU failure, you’ll want to look at the full logs in /var/snap/lxd/common/lxd/logs.
This may tell you what bit failed to serialize, then your options are to either get rid of whatever caused the serialization failure, or go at https://github.com/checkpoint-restore/criu and hunt down a matching issue or file a new one to get the problem sorted.