Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error] podman returns "Error: open /etc/containers/policy.json: no such file or directory" lilipod works #1509

Open
Sunspark-007 opened this issue Aug 7, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Sunspark-007
Copy link

Describe the bug
Following the documentation on installing distrobox on SteamOS 3.4 there is an issue. When the time comes to create a container it fails, e.g.

(deck@steamdeck bin)$ distrobox create -i ubuntu:24.04
Image ubuntu:24.04 not found.
Do you want to pull the image now? [Y/n]: 
✔ docker.io/library/ubuntu:24.04
Error: open /etc/containers/policy.json: no such file or directory

To Reproduce
Follow the install instructions on the distrobox page which uses podman.

Expected behavior
I expected the image to download and install without further intervention.

The instructions do not currently advise the user to manually create an /etc/containers/ folder and place a policy file in it. If this is required, then the documentation needs to be updated with the steps that are needed, a copy of the file, etc.

Additional context

Experimenting by not using podman and using lilipod instead works.

(deck@steamdeck bin)$ distrobox create -i ubuntu:24.04
Image ubuntu:24.04 not found.
Do you want to pull the image now? [Y/n]: 
pulling image manifest: index.docker.io/library/ubuntu:24.04
pulling layer 9c704ecd0c694c4cbdd85e589ac8d1fc3fd8f890b7f3731769a5b169eb495809.tar.gz
Copying blob sha256:9c704ecd0c694c4cbdd85e589ac8d1fc3fd8f890b7f3731769a5b169eb495809   1% |    

@Sunspark-007
Copy link
Author

Sunspark-007 commented Aug 9, 2024

Ok, I have a fix.. but the documentation for 3.4 needs to be updated.

To make podman work, in the directory /home/deck/.config/ create a folder called containers and place a file named policy.json in there.

The file to contain the contents:

        {
          "default": [
            {
              "type": "insecureAcceptAnything"
            }
          ]
        }

Additionally, there is some evidence that the image originally retrieved by lilipod was incompatible with podman as it wanted to start over and there seemed to be conflicts.. to clear out the mess from both lilipod and podman it is necessary to issue commands in both to erase/reset. You cannot rm -rf, you have to clean. With lilipod ps it would say invalid container, cleaning up.. so after that lilipod rmi --all to get rid of most of it. Then for podman there are prune commands, but podman system reset will probably handle it all. Now that it's mostly been removed you can start over with the image using podman.

Can someone tell me why I cannot rm -rf podman-static to really start over from scratch? There seems to be some sort of overlay lock protecting the folder. Update: I have managed to remove all the overlays through an annoying process of stopping images, containers, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant