Using Kali Linux Podman Images

Podman has very nice documentation on how to install it on various systems. We recommend to follow the official documentation, however for a Debian-based system it is a very simple command:

[email protected]:~$ sudo apt update && sudo apt install -y podman
...
[email protected]:~$

The Kali images are in the containers shortnames list. This allows the functionality of only calling kali-rolling, rather than using the full image name docker.io/kalilinux/kali-rolling. This works if the host system provides an up-to-date shortnames list in /etc/containers/registries.conf.d/shortnames.conf. As we are using Kali Linux, which does, we can utilize this functionality.

To use the Kali Linux Podman image, we will do the following commands:

[email protected]:~$ podman pull kali-rolling
[email protected]:~$
[email protected]:~$ podman run --tty --interactive kali-rolling
┌──(root㉿7df5f0dbe6b7)-[/]
└─#

┌──(root㉿7df5f0dbe6b7)-[/]
└─# exit
[email protected]:~$

Please note, that this does not allow for systemd functionality, which would allow access to items such as systemctl.

Please also note, the images do not come with the “default” metapackage. You will need to apt update && apt -y install kali-linux-headless.

To resume an exited container we will complete the following:

[email protected]:~$ podman ps -a
CONTAINER ID  IMAGE                                    COMMAND     CREATED        STATUS                   PORTS       NAMES
7df5f0dbe6b7  docker.io/kalilinux/kali-rolling:latest  /bin/bash   2 seconds ago  Exited (0) 1 second ago              cool_tharp
[email protected]:~$
[email protected]:~$ podman start 7df5f0dbe6b7
[email protected]:~$

After you execute the following command you will attach to the Podman container, however you must press return once to fully see the prompt.

[email protected]:~$ podman attach 7df5f0dbe6b7

┌──(root㉿7df5f0dbe6b7)-[/]
└─#

This will resume the container in whatever state you left it after running the initial podman run command or the last podman start and podman attach sequence.

Finally, if you’re done with the container you can remove it with the following command:

[email protected]:~$ podman rm 7df5f0dbe6b7
7df5f0dbe6b7
[email protected]:~$

Updated on: 2022-Sep-14
Author: gamb1t