I am trying basically to run images on a RHEL 9 machine, keeping my own user (so using --userns=keep-id, which for huge images brings issues like #16541 but that's another story), but I don't wish these images to modify my $HOME (while still having my existing $HOME files available). It seems the overlay machinery is unable to create an overlay when it the folder being bind mounted actually contains the internal podman storage files (so upper/lower/workdir/merged directories).
In other words, in a rootless configuration, this doesn't work:
[podman@11a9ab3e92cf ~]$ podman run -v "${HOME}:${HOME}:O" fedora
Error: OCI runtime error: crun: mount `/home/podman/.local/share/containers/storage/overlay-containers/f0cf1a3d50cd3a6ab58c81d98b69049b1cbc99e60ff2fce3c7e20f224cbb51d5/userdata/overlay/3517835219/merge` to `home/podman`: Invalid argument
But overlay bind-mounting any subfolder of $HOME which isn't doesn't contain ${HOME}/.local/share is fine. For example this works fine:
[podman@11a9ab3e92cf ~]$ podman run -v "${HOME}/.config:${HOME}/.config:O" fedora
I was wondering if this is expected ? In the end I would like to run something like:
and act "as if" my user inside the container was kind of the same than the user outside the container, but with no change of ${HOME} propagated back to my real ${HOME).
Run such a container using a non root user (and make sure your storage is the default one, inside $HOME):
[podman@11a9ab3e92cf ~]$ podman run -v "${HOME}:${HOME}:O" fedora
Describe the results you received
Error: OCI runtime error: crun: mount `/home/podman/.local/share/containers/storage/overlay-containers/f0cf1a3d50cd3a6ab58c81d98b69049b1cbc99e60ff2fce3c7e20f224cbb51d5/userdata/overlay/3517835219/merge` to `home/podman`: Invalid argument
Describe the results you expected
It should work without error.
podman info output
I tried the above in the `quay.io/podman/upstream` image started in `--privileged` mode. I also tried this on my RHEL 9 VM, which currently has podman 4.2.
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting
Issue Description
Hi,
I am trying basically to run images on a RHEL 9 machine, keeping my own user (so using --userns=keep-id, which for huge images brings issues like #16541 but that's another story), but I don't wish these images to modify my
$HOME
(while still having my existing$HOME
files available). It seems the overlay machinery is unable to create an overlay when it the folder being bind mounted actually contains the internal podman storage files (so upper/lower/workdir/merged directories).In other words, in a rootless configuration, this doesn't work:
But overlay bind-mounting any subfolder of
$HOME
which isn't doesn't contain${HOME}/.local/share
is fine. For example this works fine:I was wondering if this is expected ? In the end I would like to run something like:
and act "as if" my user inside the container was kind of the same than the user outside the container, but with no change of
${HOME}
propagated back to my real${HOME)
.PS: I have heard about toolbox (https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/) but I didn't try yet and I don't know if it does more or less what I am trying to do directly with podman.
Cheers, Romain
Steps to reproduce the issue
Steps to reproduce the issue
$HOME
):Describe the results you received
Describe the results you expected
It should work without error.
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
Additional environment details
Additional information
Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting