Fork of lukaszlach/kali-desktop
Modified because the kali-desktop image that lukaszlach uses and his own image have not been updated in almost 2 years.
I added arm64 images, but the build still lacks automation. The Dockerfile supports amd64 and arm64, build with the following steps:
# buildx command to build a new latest tag for all platforms
docker buildx build --push --platform linux/arm64,linux/amd64 -t ccharon/kali-desktop .
# after it finishes create additional manifest files for additional tags
# 1. get sha sums of the images just created
docker manifest inspect ccharon/kali-desktop:latest | jq '.manifests' | jq '.[].digest'
# this returns 2 sha256 hashes like these
#"sha256:5f3ab874cff9653bf75507f0b2480f7b17d755ad68d3d53c5172e486c7e5ac2d"
#"sha256:e8d28b02571eb8fcbef4c913e977c2eef82f105e5d503688113cbe0048136061"
# 2. create a new manifest with the desired tag using the shasums from above
docker manifest create ccharon/kali-desktop:2021.4 \
ccharon/kali-desktop@sha256:5f3ab874cff9653bf75507f0b2480f7b17d755ad68d3d53c5172e486c7e5ac2d \
ccharon/kali-desktop@sha256:e8d28b02571eb8fcbef4c913e977c2eef82f105e5d503688113cbe0048136061
# 3. push this new manifest
docker manifest push ccharon/kali-desktop:2021.4
# repeat 2 and 3 for as many tags as desired
Like the original image all dependencies are included. After starting the image you can open your webbrowser at http://localhost:6080/vnc_auto.html and start.
docker run -d \
-p 5900:5900 -p 6080:6080 \
--privileged \
-e RESOLUTION=1280x1024x24 \
-e USER=${USER}\
-e PASSWORD=kali \
-e ROOT_PASSWORD=root \
-v ${HOME}/kali:${HOME} \
--name kali-desktop \
ccharon/kali-desktop:latest
--network host
- optional but recommended, use the host network interfaces, if you do not need to use this option you have to manually publish the ports by passing-p 5900:5900 -p 6080:6080
--privileged
- optional but recommended-e RESOLUTION
- optional, set streaming resolution and color depth, default1280x1024x24
-e USER
- optional, work as a user with provided name, defaultroot
-e PASSWORD
- optional, provide a password for USER, defaultkali
-e ROOT_PASSWORD
- optional, provide password for root, defaultroot
-v /home/kali:/home/kali
- optional, if USER was provided it is a good idea to persist user settings, work files and look-and-feel
5900/tcp
- VNC6080/tcp
- noVNC, web browser VNC client
Simple docker compose file without persistent home and without privileged networking
docker build -f Dockerfile -t kali-desktop:latest .
mostly for myself as it took me a while to understand 😁
At first the kali-rolling docker image gets extended by:
- kali-desktop-xfce
- kali-tools-top10
- vnc stuff (x11vnc, xvfb and novnc)
Then the S6 init overlay gets installed. There are several scripts controlled by s6 that make this image work.
When launching a container 01-init is executed. This creates the specified user and sets the provided passwords.
After init, some service get started
-
xvfb - xserver that does not need a graphics card, it provides a virtual framebuffer and has no real input devices
-
gui - starts XFCE the graphical desktop environment
-
x11vnc - VNC Server to connect via noVNC
-
websockify - translate noVNC Websocket to TCP
See all available Docker image tags on Docker Hub.
MIT License
Copyright (c) 2018 Łukasz Lach [email protected]
Copyright (c) 2021 ccharon
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.