Installing kali on QNAP container station

After some testing I finally got somewhat working kali on Qnap working.
System: QTS 5.2.3.3006 and Container station Version 3.0.9.1038 (2024/11/08)
that has Docker version 27.1.2.
(Sorry for using screenshots, will replace them if systems allows me to as I’m running into 403 and brute shell scripts,)
Over all process: Create base image with the following docker file
contents of Dockerfile


contents of systemd.sh

contents of postinstall.sh

once you have the image you need to run it in privileged mode and with /sbin/init as command

docker run -itd --privileged <your_image> /sbin/init

and finally run the postinstall.sh script in a shell in the container.

docker exec -it <your_container> /bin/bash /root/postinstll.sh

After this stage commit the container to make a starting point where you can continue like stock kali-rolling image:

docker commit <your_container> <your_image>

Hope this helps someone with not so stock docker


Teemu
Disclaimer: you might need to edit the postinstall.sh script if any of the dependencies of the folowing packages add more dependencies or the name of the package .deb file changes :

  • udev
  • polkitd
  • stunnel4