How to change podman runRoot of a user ?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • Red Hat Enterprise Linux 10
  • podman

Resolution

  • runRoot is the storage state directory where all the state information is stored.
  • Default runRoot is /run/containers/storagefor root user and /run/user/$UID/run for other users.
  • This can be temporarily mentioned during the runtime of the container by specifying with a flag --runroot=/xxx(Eg. $ podman run --runroot=/xxx....)
  • To make changes across all the containers, specify the value in the configuration file
  • Configuration file for root user is /etc/containers/storage.conf and ~/.config/containers/storage.conf for rootless user
  • Modify the value for runRoot like below,
[storage]
runroot = "/xxx"

where /xxx can correspond to any preferred location.
- Once the changes are made, it can be verified by running podman info

# podman info | grep runRoot
  runRoot: /xxx
  • For Red Hat Enterprise Linux 8+ it is recommended to run podman system reset as the user runRoot is changed for. This will make sure the changes are reflected in actual working.
    Note:
  • Running podman system reset will reset podman to it's default state erasing all custom networks, volumes, and removing all containers and images.
  • runRoot should always be mapped to a tmpfs file system(non-persistent storage that will be erased upon every reboot of host) so that the metadata will be refreshed and loaded every time the host is rebooted

Diagnostic Steps

  • Check the runRoot from podman info
# podman info | grep runRoot
  runRoot: /any-preferred-location

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments