Full Kali desktop in a docker container.
2.5K
Why this Contianer:
I needed the ability to run a full GUI kali image without deploying additional tin, or a hypervisor. I did however have a docker server handy, on which to run this container.
This docker container is built with kvm, qemu and virt-manager installed, and bundled with a qcow2 disk image with full-blown Kali desktop image installed. The qcow2 image is already imported into virt-manager and the container will automatically boot the Kali VM when the container is started, and will reboot the VM is the user shuts it down (to save on support calls to the docker admin).
I'll add more documentation when I further develop the build. I may also publish the process I used to create this container as it can feasibly be used to deploy any OS that can be installed in kvm/qemu as an immutable docker container by installing and customising the OS in that qcow2 virtual disk file and importing it into virt manager like I have done here, then bundling up the resulting qcow2 in a new docker image.
The current version of this container is pre-configured with a user account with ID: kaliuser and PW: kalipassword
It is recommended that you change the password immediately on first logon.
Right now, the following is important to note:
Configuration:
Very little configuration is currently required for this image to work, but reach out if you get stuck.
Running Arbitrary Scripts:
I've added the ability to run any arbitrary scripts that you may need to run when the container starts up. Any executable script that you place in the startup-scripts volume will be executed before the embedded kali image is started. So if you want to do something with routing, or you need to edit a file or define additional variables, you can do it here.
docker run -d --privileged \
--name kali \
--cgroupns host \
--device=/dev/kvm \
--device=/dev/net/tun \
-e MEMORY=4096 \
-e CPU=4 \
-v startup-scripts:/scripts \
-v /sys/fs/cgroup:/sys/fs/cgroup:rw \
-p 0.0.0.0:5900:5900/tcp \
--cap-add=NET_ADMIN \
--cap-add=SYS_ADMIN \
gregewing/vdesktop_kali:latest
Environment Variables
CPU - used to set the number of vCPU Cores to assign to the kali VM in kvm.
MEMORY - used to set the number of RAM Cores to assign to the kali VM in kvm.
Please note that these configurables are not yet fully functional in the image, and they are capped at 4 CPU Cores and 4 GB RAM, you cannot go above this without some rework. Contact me if you need to know more about how to do this via the github repo for this image : https://github.com/gregewing/vdesktop_kali/tree/main
Content type
Image
Digest
sha256:bf716586e…
Size
7.6 GB
Last updated
8 months ago
docker pull gregewing/vdesktop_kali