You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ref : continues from #142
Currently youki supports checkpointing, (with command name checkpointt) , but the restore part has not been implemented yet. We should do that.
Note Before anyone starts with this, make sure the following commands are working as expected on your system:
# run a loop which keeps printing numbers, with runc runtime ; in background
sudo podman run --runtime runc -dt fedora bash -c "v=0;while true;do sleep 1; echo \"\$v\"; let \"v++\";done;"# get the name/id of the launched container
sudo podman ps
# this will attach current console to the container. DO NOT do ctrl+c to exit, instead use `a` key# keep running for some time, let the number increase
sudo podman attach <container-id/name> --detach-keys=a
# enter a, and detach again# checkpoint and shut-down container
sudo podman container checkpoint <container-id/name># wait for a bit# restore the container
sudo podman container restore <container-id/name># attach again immediately
sudo podman attach <container-id/name> --detach-keys=a
# in the output you see should print numbers >greater than what we saw in previous attach with considerable range
After that implement restore in youki, rename the checkpointt to checkpoint and make the above work with youki instead of runc.
Another Note criu library is quite specific with which kernel versions it supports and need. If you run into criu failure with seg-fault , check previous issues on criu and check if you need to upgrade/downgrade library version for your kernel.
I ran above on ubuntu-based, kernel version 6.4.6 , criu v3.17.1 (3.16 does not work)
Hey, I'm trying to research checkpoint and restore. However, I've noticed that there seem to be some problems with the current checkpoint implementation.
> sudo podman run --runtime ~/rust_project/youki/youki -dt fedora bash -c "v=0;while true;do sleep 1; echo \"\$v\"; let \"v++\";done;"> sudo podman container --runtime ~/rust_project/youki/youki ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
eb0b484cafdc registry.fedoraproject.org/fedora:latest bash -c v=0;while... 17 minutes ago Up 17 minutes ago musing_cohen
> sudo podman container --runtime ~/rust_project/youki/youki checkpoint eb0b484cafdc21a4d9
DEBUG youki: started by user 0 with ArgsOs { inner: ["/home/yjn/rust_project/youki/youki", "checkpoint", "--image-path", "/var/lib/containers/storage/overlay-containers/eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280/userdata/checkpoint", "--work-path", "/var/lib/containers/storage/overlay-containers/eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280/userdata", "eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280"] }
DEBUG youki::commands::checkpoint: start checkpointing container eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280
ERROR libcontainer::container::container_checkpoint: failed to open criu image directory path="/var/lib/containers/storage/overlay-containers/eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280/userdata/checkpoint" err=Os { code: 2, kind: NotFound, message: "No such file or directory" }
ERROR youki: error in executing command: failed to checkpoint container eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280
Caused by:
0: io error
1: No such file or directory (os error 2)
Error: failed to checkpoint container eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280
Caused by:
0: io error
1: No such file or directory (os error 2)
Error: `/home/yjn/rust_project/youki/youki checkpoint --image-path /var/lib/containers/storage/overlay-containers/eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280/userdata/checkpoint --work-path /var/lib/containers/storage/overlay-containers/eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280/userdata eb0b484cafdc21a4d9017f3723127e33a10366b5a963cd78f1d38127f681f280` failed: exit status 1
Of course, I've made the necessary changes to rename the checkpointt subcommand to checkpoint.
I believe the cause of the error is likely not related to my system environment (e.g., CRIU) because I can perform checkpoint and restore using podman + runc.
After resolving the mentioned No such file or directory error, there are still some CRIU-related errors:
> sudo podman container checkpoint fb8bc5974
DEBUG youki: started by user 0 with ArgsOs { inner: ["/home/yjn/rust_project/youki/youki", "checkpoint", "--image-path", "/var/lib/containers/storage/overlay-containers/fb8bc5974a8854d9d9a77d2438937a412f0bdf1e710f97c148981a19b0718eea/userdata/checkpoint", "--work-path", "/var/lib/containers/storage/overlay-containers/fb8bc5974a8854d9d9a77d2438937a412f0bdf1e710f97c148981a19b0718eea/userdata", "fb8bc5974a8854d9d9a77d2438937a412f0bdf1e710f97c148981a19b0718eea"] }
DEBUG youki::commands::checkpoint: start checkpointing container fb8bc5974a8854d9d9a77d2438937a412f0bdf1e710f97c148981a19b0718eea
ERROR libcontainer::container::container_checkpoint: checkpointing container failed err="CRIU RPC request failed with message:Error (criu/files-reg.c:1815): Can't lookup mount=26 for fd=0 path=/dev/pts/5\n error:0" id="fb8bc5974a8854d9d9a77d2438937a412f0bdf1e710f97c148981a19b0718eea" logfile="/var/lib/containers/storage/overlay-containers/fb8bc5974a8854d9d9a77d2438937a412f0bdf1e710f97c148981a19b0718eea/userdata/checkpoint/dump.log"
ERROR youki: error in executing command: failed to checkpoint container fb8bc5974a8854d9d9a77d2438937a412f0bdf1e710f97c148981a19b0718eea
Caused by:
CRIU RPC request failed with message:Error (criu/files-reg.c:1815): Can't lookup mount=26 for fd=0 path=/dev/pts/5
error:0
Error: failed to checkpoint container fb8bc5974a8854d9d9a77d2438937a412f0bdf1e710f97c148981a19b0718eea
Caused by:
CRIU RPC request failed with message:Error (criu/files-reg.c:1815): Can't lookup mount=26 for fd=0 path=/dev/pts/5
error:0
Error: `/home/yjn/rust_project/youki/youki checkpoint --image-path /var/lib/containers/storage/overlay-containers/fb8bc5974a8854d9d9a77d2438937a412f0bdf1e710f97c148981a19b0718eea/userdata/checkpoint --work-path /var/lib/containers/storage/overlay-containers/fb8bc5974a8854d9d9a77d2438937a412f0bdf1e710f97c148981a19b0718eea/userdata fb8bc5974a8854d9d9a77d2438937a412f0bdf1e710f97c148981a19b0718eea` failed: exit status 1
I'd like to know if these errors can be reproduced by others? Is it necessary to open a separate issue to address the potential problems with checkpoint?
After resolving the mentioned No such file or directory error,
Hey, can you mention what what the issue behind this error, and how did you resolve it?
I'd like to know if these errors can be reproduced by others? Is it necessary to open a separate issue to address the potential problems with checkpoint?
I haven't tried running checkpoint before, I had assumed it was working. I will try running and checking for errors that you encountered. If this is a bug, and not just setup issue, then we can either fix it along with restore impl, or open separate issue.
There is indeed some issue in checkpoint impl, as same error also occurs on my system as well. There is an issue open on criu that has similar to error checkpoint-restore/criu#1785 , but needs more investigation on why it is happening. Thanks for checking and reporting. The initial issue of image_path not existing also needs to be checked, verifying on how runc handles this...
CRIU RPC request failed with message:Error (criu/files-reg.c:1815): Can't lookup mount=26 for fd=0 path=/dev/pts/5
@adrianreber can you help us with some suggestions regarding this error in checkpointing ? I saw the issues checkpoint-restore/criu#860 and checkpoint-restore/criu#1785 , but the kernel issue in the first one does not seem applicable. As mentioned by @anti-entropy123 , the checkpointing is working with runc, so what can be a potential cause for this particular error, or what might be a good idea for trying to debug this?
Not sure what the question is, but I can only recommend not to use Ubuntu for CRIU. There are non upstream kernel patches which break CRIU all the time. Sorry.
while trying out the current implementation of youki's checkpoint both @anti-entropy123 and me are getting error from criu CRIU RPC request failed with message:Error (criu/files-reg.c:1815): Can't lookup mount=26 for fd=0 path=/dev/pts/5 ; even though running checkpoint with runc works fine and gives no error. I didn't think that kernel would be an issue as runc is successful in using criu to checkpoint.
The issues I linked in the previous comment were about the same error message, but the first one is regarding kernel problems (on which even runc was failing, hence I don't think it is applicable here), and second one is still open. I wanted to ask if you have any idea why this error might crop up, or any good place to start debugging why this error is getting thrown? Thanks :)
Ah, I see. The current implementation does only work without a connected terminal. To handle the terminal correctly additional steps are necessary. Especially during restore a callback is necessary to tell youki the correct tty FD.
You should look at crun as the criu rust bindings are closer to the c bindings from the architecture.
The main thing which is missing in rust-criu is the callback for the new console socket. The code exists in C and Go so that it should not be too difficult to implement it in Rust.
First, I addressed the following error that occurs during checkpoint execution:
CRIU RPC request failed with message:Error (criu/files-reg.c:1815): Can't lookup mount=26 for fd=0 path=/dev/pts/5
The technical details of the issue are as follows:
Current behavior: youki handles TTY via the host's /dev/pts.
CRIU's behavior: CRIU attempts to verify mount points from within the container's namespace.
Root cause: Because the TTY exists on the host, CRIU cannot find the corresponding mount information from inside the container, resulting in a failure.
There are two main ways to solve this:
Short-term: Enable shell_job.
Long-term: Change to use devpts inside the container (consistent with runc/crun).
I have implemented the long-term approach in this PR.
ref: #3333
@utam0k cc @YJDoc2
I would like to get your alignment on the following points regarding the implementation of Checkpoint/Restore:
Separation of Bug Fixes and New Features:
Currently, I have identified some minor bugs in the existing checkpoint logic. Should I submit a separate PR for these fixes before the restore implementation, or is it okay to include them in the restore PR?
PR Scope for Options:
There are several options for checkpoint and restore that need to be supported. Should I include all of them in a single PR, or would you prefer a phased approach—starting with a PR that covers the minimum required behavior for checkpoint/restore, followed by incremental PRs for additional options?
I am considering the following as the minimum required options:
Dependency on rust-criu:
In runc, only the protobuf structures from go-criu are used. In youki, the current implementation relies on the rust-criu crate for various functionalities. Does this approach align with our project's direction, or should we consider a more minimal dependency similar to runc?
Integration Testing Strategy:
I noticed that checkpoint/restore tests are not yet implemented in runtime-tools. While runc uses BATS for its integration tests (e.g., checkpoint.bats), I would like to know the preferred approach for youki. Should I add these to youki's integration tests (BATS), or is it better to implement them to contest?
Dependency on rust-criu:
In runc, only the protobuf structures from go-criu are used. In youki, the current implementation relies on the rust-criu crate for various functionalities. Does this approach align with our project's direction, or should we consider a more minimal dependency similar to runc?
Having written the initial youki checkpointing code and and the crun CRIU implementation as well as being involved in runc I would recommend youki follows crun's example on how to use CRIU. runc was using CRIU before go-criu existed and now runc has unnecessary details about how to communicate with CRIU. That should be in a library like libcriu that crun uses. So my suggestion for youki is to implement the restore support just like crun does and abstract whatever is possible away in rust-criu. https://github.com/containers/crun/blob/main/src/libcrun/criu.c
Should I submit a separate PR for these fixes before the restore implementation, or is it okay to include them in the restore PR?
I prefer separating the PRs. I believe it leads to greater efficiency than a single large one.
Should I include all of them in a single PR, or would you prefer a phased approach—starting with a PR that covers the minimum required behavior for checkpoint/restore, followed by incremental PRs for additional options?
For the same reason, I prefer smaller PRs. But it relies on each feature's dependencies and your preferences.
Should I add these to youki's integration tests (BATS), or is it better to implement them to contest?
Activity
YJDoc2 commentedon Sep 1, 2023
You can check the crun code for help :
checkpoint : https://github.com/opencontainers/runc/blob/main/checkpoint.go
restore : https://github.com/opencontainers/runc/blob/main/restore.go
anti-entropy123 commentedon Sep 23, 2023
Hey, I'm trying to research
checkpointandrestore. However, I've noticed that there seem to be some problems with the currentcheckpointimplementation.Of course, I've made the necessary changes to rename the
checkpointtsubcommand tocheckpoint.I believe the cause of the error is likely not related to my system environment (e.g., CRIU) because I can perform
checkpointand restore usingpodman+runc.anti-entropy123 commentedon Sep 23, 2023
After resolving the mentioned
No such file or directoryerror, there are still some CRIU-related errors:I'd like to know if these errors can be reproduced by others? Is it necessary to open a separate issue to address the potential problems with
checkpoint?YJDoc2 commentedon Sep 25, 2023
Hey, can you mention what what the issue behind this error, and how did you resolve it?
I haven't tried running checkpoint before, I had assumed it was working. I will try running and checking for errors that you encountered. If this is a bug, and not just setup issue, then we can either fix it along with restore impl, or open separate issue.
anti-entropy123 commentedon Sep 25, 2023
It's quite simple, just create the missing directories directly. (It seems to be the case in runc as well.)
YJDoc2 commentedon Sep 26, 2023
There is indeed some issue in checkpoint impl, as same error also occurs on my system as well. There is an issue open on criu that has similar to error checkpoint-restore/criu#1785 , but needs more investigation on why it is happening. Thanks for checking and reporting. The initial issue of
image_pathnot existing also needs to be checked, verifying on how runc handles this...anti-entropy123 commentedon Sep 26, 2023
Thanks for your sharing too~
I noticed that, the way runc handles
image_pathis also to create it directly. https://github.com/opencontainers/runc/blob/a32ad76da330c20c27b79ccbd20ff58629fc4b7d/libcontainer/criu_linux.go#L303C15-L303C15YJDoc2 commentedon Sep 26, 2023
@adrianreber can you help us with some suggestions regarding this error in checkpointing ? I saw the issues checkpoint-restore/criu#860 and checkpoint-restore/criu#1785 , but the kernel issue in the first one does not seem applicable. As mentioned by @anti-entropy123 , the checkpointing is working with runc, so what can be a potential cause for this particular error, or what might be a good idea for trying to debug this?
adrianreber commentedon Sep 26, 2023
Not sure what the question is, but I can only recommend not to use Ubuntu for CRIU. There are non upstream kernel patches which break CRIU all the time. Sorry.
YJDoc2 commentedon Sep 26, 2023
Hey, sorry if I wasn't clear :
while trying out the current implementation of youki's checkpoint both @anti-entropy123 and me are getting error from criu
CRIU RPC request failed with message:Error (criu/files-reg.c:1815): Can't lookup mount=26 for fd=0 path=/dev/pts/5; even though running checkpoint with runc works fine and gives no error. I didn't think that kernel would be an issue as runc is successful in using criu to checkpoint.The issues I linked in the previous comment were about the same error message, but the first one is regarding kernel problems (on which even runc was failing, hence I don't think it is applicable here), and second one is still open. I wanted to ask if you have any idea why this error might crop up, or any good place to start debugging why this error is getting thrown? Thanks :)
adrianreber commentedon Sep 26, 2023
Ah, I see. The current implementation does only work without a connected terminal. To handle the terminal correctly additional steps are necessary. Especially during restore a callback is necessary to tell youki the correct tty FD.
You should look at crun as the criu rust bindings are closer to the c bindings from the architecture.
anti-entropy123 commentedon Sep 27, 2023
Thank you for your help. I removed the
-tflag, and now it's working fine. @adrianrebernayuta723 commentedon Dec 19, 2025
Is anyone currently working on this? If not, I'm interested and would like to take this on.
utam0k commentedon Dec 20, 2025
@nayuta723 Thanks for raising your hand. I've assigned it to you.
adrianreber commentedon Dec 20, 2025
The main thing which is missing in rust-criu is the callback for the new console socket. The code exists in C and Go so that it should not be too difficult to implement it in Rust.
nayuta723 commentedon Dec 29, 2025
First, I addressed the following error that occurs during checkpoint execution:
The technical details of the issue are as follows:
There are two main ways to solve this:
I have implemented the long-term approach in this PR.
ref: #3333
nayuta723 commentedon Jan 12, 2026
@utam0k cc @YJDoc2
I would like to get your alignment on the following points regarding the implementation of Checkpoint/Restore:
Currently, I have identified some minor bugs in the existing
checkpointlogic. Should I submit a separate PR for these fixes before therestoreimplementation, or is it okay to include them in therestorePR?There are several options for
checkpointandrestorethat need to be supported. Should I include all of them in a single PR, or would you prefer a phased approach—starting with a PR that covers the minimum required behavior forcheckpoint/restore, followed by incremental PRs for additional options?I am considering the following as the minimum required options:
--image-path,--work_path--pid-file,--detach,--image-path,--work-path,--console-socketrust-criu:In
runc, only the protobuf structures fromgo-criuare used. Inyouki, the current implementation relies on therust-criucrate for various functionalities. Does this approach align with our project's direction, or should we consider a more minimal dependency similar torunc?I noticed that checkpoint/restore tests are not yet implemented in runtime-tools. While runc uses BATS for its integration tests (e.g., checkpoint.bats), I would like to know the preferred approach for youki. Should I add these to youki's integration tests (BATS), or is it better to implement them to
contest?Draft PRs for reference:
adrianreber commentedon Jan 12, 2026
Having written the initial youki checkpointing code and and the crun CRIU implementation as well as being involved in runc I would recommend youki follows crun's example on how to use CRIU. runc was using CRIU before go-criu existed and now runc has unnecessary details about how to communicate with CRIU. That should be in a library like libcriu that crun uses. So my suggestion for youki is to implement the restore support just like crun does and abstract whatever is possible away in rust-criu. https://github.com/containers/crun/blob/main/src/libcrun/criu.c
utam0k commentedon Jan 15, 2026
I prefer separating the PRs. I believe it leads to greater efficiency than a single large one.
For the same reason, I prefer smaller PRs. But it relies on each feature's dependencies and your preferences.
First, we should try using
contestin youki way.nayuta723 commentedon Jan 18, 2026
TODO
Pre-requisites for checkpoint/restore implementation
Checkpoint
image_path,work_path) @nayuta723Restore
Add contest