title: Podman in Podman, similar to Docker in Docker?
body: <p>Is there a way to run Podman inside Podman, similar to the way you can run Docker inside Docker?</p>
  <p>Here is a snippet of my Dockerfile which is strongly based on <a href="https://stackoverflow.com/questions/56032747/how-to-run-podman-from-inside-a-container">another question</a>:</p>
  <pre><code>FROM debian:10.6
  
  RUN apt update &amp;&amp; apt upgrade -qqy &amp;&amp; \
      apt install -qqy iptables bridge-utils \
                       qemu-kvm libvirt-daemon libvirt-clients virtinst libvirt-daemon-system \
                       cpu-checker kmod &amp;&amp; \
      apt -qqy install curl sudo gnupg2 &amp;&amp; \
      echo &quot;deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/ /&quot; &gt; /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list &amp;&amp; \
      curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/Debian_10/Release.key | sudo apt-key add - &amp;&amp; \
      apt update &amp;&amp; \
      apt -qqy install podman
  </code></pre>
  <p>Now trying some tests:</p>
  <pre><code>$ podman run -it my/test bash -c &quot;podman --storage-driver=vfs info&quot;
  ... (long output; this works fine)
  
  $ podman run -it my/test bash -c &quot;podman --storage-driver=vfs images&quot;
  ERRO[0000] unable to write system event: &quot;write unixgram @000ec-&gt;/run/systemd/journal/socket: sendmsg: no such file or directory&quot; 
  REPOSITORY  TAG     IMAGE ID  CREATED  SIZE
  
  $ podman run -it my/test bash -c &quot;podman --storage-driver=vfs run docker.io/library/hello-world&quot;
  ERRO[0000] unable to write system event: &quot;write unixgram @000ef-&gt;/run/systemd/journal/socket: sendmsg: no such file or directory&quot; 
  Trying to pull docker.io/library/hello-world...
  Getting image source signatures
  Copying blob 0e03bdcc26d7 done  
  Copying config bf756fb1ae done  
  Writing manifest to image destination
  Storing signatures
  ERRO[0003] unable to write pod event: &quot;write unixgram @000ef-&gt;/run/systemd/journal/socket: sendmsg: no such file or directory&quot; 
  ERRO[0003] Error preparing container 66692b7ff496775499d405d538769a078f2794549955cf2409fcbcbf87f42e94: error creating network namespace for container 66692b7ff496775499d405d538769a078f2794549955cf2409fcbcbf87f42e94: mount --make-rshared /var/run/netns failed: &quot;operation not permitted&quot; 
  Error: failed to mount shm tmpfs &quot;/var/lib/containers/storage/vfs-containers/66692b7ff496775499d405d538769a078f2794549955cf2409fcbcbf87f42e94/userdata/shm&quot;: operation not permitted
  </code></pre>
  <p>I've also tried a suggestion from the <a href="https://stackoverflow.com/questions/56032747/how-to-run-podman-from-inside-a-container">other question</a>, passing <code>--cgroup-manager=cgroupfs</code>, but without success:</p>
  <pre><code>$ podman run -it my/test bash -c &quot;podman --storage-driver=vfs --cgroup-manager=cgroupfs run docker.io/library/hello-world&quot;
  Trying to pull docker.io/library/hello-world...
  Getting image source signatures
  Copying blob 0e03bdcc26d7 done  
  Copying config bf756fb1ae done  
  Writing manifest to image destination
  Storing signatures
  ERRO[0003] unable to write pod event: &quot;write unixgram @000f3-&gt;/run/systemd/journal/socket: sendmsg: no such file or directory&quot; 
  ERRO[0003] Error preparing container c3fff4d8161903aaebd6f89f3b3c06b55038e11e07b6b561dc6576ca675747a3: error creating network namespace for container c3fff4d8161903aaebd6f89f3b3c06b55038e11e07b6b561dc6576ca675747a3: mount --make-rshared /var/run/netns failed: &quot;operation not permitted&quot; 
  Error: failed to mount shm tmpfs &quot;/var/lib/containers/storage/vfs-containers/c3fff4d8161903aaebd6f89f3b3c06b55038e11e07b6b561dc6576ca675747a3/userdata/shm&quot;: operation not permitted
  </code></pre>
  <p>Seems like some network configuration is needed. I found the project below which suggests that some tweaking on network configurations might be necessary, but I don't know what would be the context of that and whether it would apply here or not.
  <a href="https://github.com/joshkunz/qemu-docker" rel="noreferrer">https://github.com/joshkunz/qemu-docker</a></p>
  <p><strong>EDIT</strong>: I've just discovered <code>/var/run/podman.sock</code>, but also without success:</p>
  <pre><code>$ sudo podman run -it -v /run/podman/podman.sock:/run/podman/podman.sock my/test bash -c &quot;podman --storage-driver=vfs --cgroup-manager=cgroupfs run docker.io/library/hello-world&quot;
  Trying to pull my/test...
    denied: requested access to the resource is denied
  Trying to pull my:test...
    unauthorized: access to the requested resource is not authorized
  Error: unable to pull my/text: 2 errors occurred:
          * Error initializing source docker://my/test: Error reading manifest latest in docker.io/my/test: errors:
  denied: requested access to the resource is denied
  unauthorized: authentication required
  
          * Error initializing source docker://quay.io/my/test:latest: Error reading manifest latest in quay.io/my/test: unauthorized: access to the requested resource is not authorized
  </code></pre>
  <p>Seems like <code>root</code> cannot see the images I've created under my user.</p>
  <p>Any ideas? Thanks.</p>