distrobox icon indicating copy to clipboard operation
distrobox copied to clipboard

On Fedora 36: Ubuntu 20.04 container save and restore seems not working

Open kkarsten62 opened this issue 2 years ago • 4 comments

Please, can somebody retest the following procedure. I not sure if it is a bug or it depends on my Fedora 36 environment.

I am on Fedora 36, login with GNOME / X. distrobox version 1.3.1, installed by sudo dnf install distrobox

I am getting error messages after starting a saved and restored container. Based on: https://distrobox.privatedns.org/useful_tips.html#container-save-and-restore

Get a clean environment, stop and remove all containers and images. WARNING: You are removing all your containers and images!

podman container stop $(podman container ls -aq)
podman container rm $(podman container ls -aq)
podman image rm $(podman image ls -aq)

Create tar.gz snapshot

distrobox-create --name ergo0 --image ubuntu:20.04
distrobox enter ergo0
exit
podman container commit -p ergo0 ergo0_export
podman save localhost/ergo0_export:latest | gzip > ergo0_export.tar.gz

Get a clean environment, stop and remove all containers and images. WARNING: You are removing all your containers and images!

podman container stop $(podman container ls -aq)
podman container rm $(podman container ls -aq)
podman image rm $(podman image ls -aq)

Load snapshot

podman load < ergo0_export.tar.gz
distrobox-create --image localhost/ergo0_export:latest --name ergo0
distrobox enter ergo0

Output with error message is:

Container ergo0 is not running.
Starting container ergo0
run this command to follow along:

 podman logs -f ergo0

Error: could not start entrypoint.
...
+ mount --rbind -o ro /run/host/var/lib/flatpak /var/lib/flatpak
mount: only root can use "--rbind" option (effective UID is 1)
+ printf Warning: failed to bind mount %s to %s\n /run/host/var/lib/flatpak /var/lib/flatpak
+ return 1
+ [ 1 -ne 0 ]
+ printf Error: An error occurred\n
...
distrobox: Setting up read-only mounts
...
/var/lib/flatpak is not a mountpoint
Warning: failed to bind mount /run/host/var/lib/flatpak to /var/lib/flatpak
Error: An error occurred

An error occurred

An error occurred

kkarsten62 avatar Aug 27 '22 19:08 kkarsten62

Can you try using podman system migrate just after importing the image (and before creating a container from it)?

89luca89 avatar Aug 28 '22 14:08 89luca89

Same behaviour. I enter:

...
podman load < ergo0_export.tar.gz
podman system migrate
distrobox-create --image localhost/ergo0_export:latest --name ergo0
distrobox enter ergo0

Same error message appears.

kkarsten62 avatar Aug 29 '22 10:08 kkarsten62

I'm not sure if this is a distrobox problem or a podman problem I'll try to reproduce, but after some try I still wasn't able to

89luca89 avatar Aug 31 '22 23:08 89luca89

I tried the above steps, but they work for me.

alcir avatar Sep 01 '22 16:09 alcir

Same issue, running distrobox version > 1.4.1 via curl install on a Steam Deck:

curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --prefix ~/.local
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/extras/install-podman | sh -s -- --prefix ~/.local`

Wanted to move my image with work environment to a different computer. Later found out, this happens with anything I podman load < image.tar.gz and then try to distrobox create -i from it, on the same system.

My error output is exactly the same.

Will try latest git version next.

MilanKladivko avatar Dec 06 '22 13:12 MilanKladivko

(still on 1.4.1 not latest git) Tried podman system migrate and tried to enter right after:

Container work_image is not running.
Starting container work_image
run this command to follow along:

 podman logs -f work_image

Error: unable to start container "313d0988db817a73bf9e20980ba8c8b32f5d0fa72a332bb77b2c925eb684d763": unable to find user root: no matching entries in passwd file

An error occurred

An error occurred

If I try to enter again after this, it falls back to the old error message about entrypoint.

MilanKladivko avatar Dec 06 '22 13:12 MilanKladivko