NML Says

Kali from Docker

Documentation may be found at

https://www.kali.org/docs/containers/official-kalilinux-docker-images/

https://www.kali.org/docs/containers/using-kali-docker-images/

https://hub.docker.com/r/kalilinux/kali-rolling

https://www.brettfullam.com/create-a-containerized-kali-linux-in-docker

The latter link explains in detail how to create a docker image of Kali on your computer including file sharing with that image and you regular file system.

If you are going to reuse the docker container, it is highly recommended.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
~ $ docker pull kalilinux/kali-rolling
~ $ docker run -itd --name kali kalilinux/kali-rolling:latest
~ $ docker exec -it kali /bin/bash

┌──(root㉿38a779b2739e)-[/]
└─# apt update && apt -y install kali-linux-headless 

# ... takes some time and requires some choices

cd /home
mkdir shared

# keep this console open

now start a second console and do

1
2
3
4
5
$ docker commit 38a779b2739e kali_base
$ docker images -a

REPOSITORY       TAG       IMAGE ID       CREATED              SIZE
kali_base        latest    5ccd28331992   About a minute ago   6.89GB

You may now exit the docker console from above. and remove the container with

1
2
3
4
$ docker ps -a
# this will give you a container name
$ docker stop <name>
$ docker rm <name>

All the above is a one time endeavour. From then you may operate you kali container as follows:

1
2
3
$ docker stop kali
$ docker rm kali
$ docker run --name kali -v /home/<uou>/kali:/home/shared -ti kali_base /bin/bash

Stopping the container is done by exit or Ctrl-d.