podman containers running under a snap package aren't visible by host's podman
1
vote
0
answers
97
views
I'm running Visual Studio Code on Ubuntu, installed as a Snap package. If I open the terminal in Visual Studio Code and use it to run a podman container - everything works fine, except that if I run podman on a local terminal, it doesn't see anything running:
$ podman ps -aq | wc -l
0
I can see the processes running in ps, with my user ID:
$ ps auxfw
...
odeda 39121 0.0 0.0 12216 2724 ? Ss 10:16 0:00 \_ /usr/bin/conmon --api-version 1 -c 7cd9293c0ed384bbebda322d366cefa2890502be3ca
odeda 39123 0.0 0.0 11444 6720 pts/0 Ss+ 10:16 0:00 | \_ nginx: master process nginx -g daemon off;
100100 39156 0.0 0.0 11912 3204 pts/0 S+ 10:16 0:00 | \_ nginx: worker process
100100 39157 0.0 0.0 11912 2884 pts/0 S+ 10:16 0:00 | \_ nginx: worker process
...
And I can see the storage files for podman in the Snap's tree:
ls -la ~/snap/code/current/.local/share/containers/storage/overlay-containers/
total 8
drwx------ 1 odeda odeda 206 Dec 27 10:16 .
drwx------ 1 odeda odeda 236 Dec 27 10:36 ..
drwx------ 1 odeda odeda 16 Dec 27 10:16 7cd9293c0ed384bbebda322d366cefa2890502be3caa60854207968a31d4bf08
-rw-r--r-- 1 odeda odeda 64 Dec 27 10:16 containers.lock
-rw------- 1 odeda odeda 533 Dec 27 10:16 volatile-containers.json
I want to work on the running container using podman exec
and such - but the podman on the host doesn't see the container:
$ podman exec -ti somecontainer /bin/bash
Error: no container with name or ID "somecontainer" found: no such container
I can run such things fine from the Visual Studio Code's terminal view - but as it is otherwise pretty terrible for serious terminal work, I'd rather not.
I'm guessing this is an artifact of the Snap containment. How do I tell the host's podman to see the podman inside the Snap containment?
Asked by Guss
(13256 rep)
Dec 27, 2024, 08:46 AM
Last activity: Dec 28, 2024, 09:44 PM
Last activity: Dec 28, 2024, 09:44 PM