Podman (distrobox) container sudo permissions issue

hi every1!!! noob here.

just trying out podman to launch some dynamic binaries (multiplayer native games), and i stumbled upon this pesky issue…

i installed podman and distrobox thusly:

  virtualisation.podman.enable = true;
  virtualisation.podman.dockerCompat = true;
  environment.systemPackages = [ pkgs.distrobox ];

as for the container, like this:

distrobox create --name fedora --init --image fedora:latest

and so after SOME TIME (a week) i got this:

📦[frog23@fedora]~% sudo test
sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: eigenaar van /usr/sbin/sudo moet gebruikersnummer 0 zijn en de setuid bit ingesteld

this applies to all and any commands that need elevated privileges… otherwise the container works fine (games work)…

i have no idea what i did and i didnt do anything! but how is THIS possible? i DID NOT (could not) update (sudo dnf update or sudo dnf upgrade), because it could not update one of the packages, filesystem, among other warnings such as Permission denied and Operation not permitted to a bunch of paths… so that cant be an update problem… (by the way, guys, please explain this to me: do you have to update the container itself, like, its packages and stuff or not?)

i have not tried reinstalling (deleting and installing) the container yet… but maybe a new one will work?

installing arch via distrobox create --name archlinux --init --image archlinux:latest

…and what do you know! sudo test works! same for sudo pacman -Syu

nevermind then hahaha… but what if it happens again? what can i do to fix or prevent it?

thanks thanks thanks!!!

hmmmm…

could it be visualisation.podman.autoPrune?

      autoPrune = {
        enable = true;
        flags = [
          "--all"
          # ...
        ];
        dates = "weekly";
      };

i… didnt really put much thought, per se, into what it does… could that be the culprit?

EDIT: no. i just reinstalled the container, sudo doesnt work immediately

err… is this supposed to happen?

my host machine doesnt have a /etc/sudo.conf, nor does it create it when i use anything with sudo…?

anyway, currently i am trying to comment out and uncomment to reinstall podman, perhaps that oughta do it!!

5 mins later… aaaand NOTHING. hopeless.

got it!

podman system reset

this DELETES all containers, but most importantly - graphRoot and runRoot directories, that FOR SOME REASON tend to change users or permissions, or whatever… i actually looked it up and apparently this is like AT LEAST a 10 year old known issue…

so, yeah… i installed my containers back and everything is back to normal (for now)…

1 Like