Builds official Kali Linux installer ISO images with simple-cdd and debian-cd, supporting multiple architectures, variants, mirrors, and containerized builds.
Kali Linux installer ISO builder, via simple-cdd (with debian-cd).
These are the same build-scripts that the Kali team uses to generate the official Kali Linux base images, found on kali.org/get-kali/.
These images can be used to install Kali with various customization during setup, from a CD/DVD/Blu-ray/USB/sdCard. For being able to live boot (e.g. try Kali out without altering any existing operating system), see kali-live:
Build your Kali, today!
We recommend building on a Linux-based host, which matches the desired architecture.
There are various ways to get ready to use kali-installer build-script. You can either:
build.sh - Build straight from your machinebuild-in-container.sh - Build from within a container (such as Docker or Podman) For build.sh to work, it will require super user access (e.g. sudo or a rootful container). However, KVM isn't required.
First install git, and make sure that the repository is cloned locally:
$ sudo apt-get install --no-install-recommends \
git ca-certificates
$ git clone https://gitlab.com/kalilinux/build-scripts/kali-installer.git
$ cd ./kali-installer/
To build directly on your host, with build.sh, install the build dependencies:
$ sudo apt-get install --no-install-recommends \
simple-cdd debian-cd \
cpio \
mtools \
dosfstools \
xorriso
Now you can use ./build.sh, which will build a Kali installer ISO straight on your machine.
If you are NOT using Kali as the base OS, you will need to install Kali's kali-archive-keyring in order for simple-cdd to fetch Kali's packages.
$ sudo apt-get install --no-install-recommends \
wget ca-certificates
$ wget https://http.kali.org/pool/main/k/kali-archive-keyring/kali-archive-keyring_20YY.X_all.deb
$ sudo apt-get install ./kali-archive-keyring_*_all.deb
$ wget https://http.kali.org/pool/main/d/debian-cd/debian-cd_*_all.deb
$ sudo apt-get install ./debian-cd_*_all.deb
NOTE: Replace 20YY.X with the values shown here, in kali-archive-keyring.
Depending on when you run this, you may also need a certain version of simple-cdd (Package Tracker: Debian/Kali) and/or debian-cd (Package Tracker: Debian/Kali).
Now you can follow Build From The Host (Kali) to install build dependencies.
We will skip over setting up any container software.
If you prefer to build from within a container, you will need to install and configure either docker or podman on your machine.
docker requires the user to be added to the Docker group, or using the root account (e.g. $ sudo ./build-in-container.sh).podman has been tested with rootful (e.g. $ sudo ./build-in-container.sh), however rootless is not supported at this time.build-in-container.sh is a wrapper on top of build.sh. It detects which OCI-compliant container engine to use, takes care of creating the container image if missing, and then it starts the container to perform the build from within.
You have three ways to provide the container image:
$ # Option #1 - Automated build (recommended)
$ ./build-in-container.sh
$ ./build-in-container.sh --force # If you need to rebuild the image from scratch
$
$
$
$ # Option #2 - Manual build
$ docker build -t kali-build/kali-installer .
$ # ...OR...
$ podman build -t kali-build/kali-installer .
$
$
$
$ # Option #3 - Use the pre-generated
$ docker pull registry.gitlab.com/kalilinux/build-scripts/kali-installer:latest
$ docker tag registry.gitlab.com/kalilinux/build-scripts/kali-installer:latest kali-build/kali-installer
$ # ...OR...
$ podman pull registry.gitlab.com/kalilinux/build-scripts/kali-installer:latest
$ podman tag registry.gitlab.com/kalilinux/build-scripts/kali-installer:latest kali-build/kali-installer
$
$ # ...then point the build at it:
$ ./build-in-container.sh # Locally built (automated or manual)
$ IMAGE=registry.gitlab.com/kalilinux/build-scripts/kali-installer:latest ./build-in-container.sh # Pre-generated
If you have both docker and podman installed, build-in-container.sh will default to using podman. To change this, prefix CONTAINER=docker before ./build-in-container.sh:
$ CONTAINER=docker ./build-in-container.sh [...]
Now you can use ./build-in-container.sh (rather than ./build.sh), to build an image.
$ ./build.sh --help
Usage: build.sh [OPTIONS]
Build a Kali Linux Installer image.
Build options:
-a, --arch ARCH Build an image for this architecture (default: amd64)
Supported: amd64 arm64 armhf
-b, --branch BRANCH Kali branch used to build the image (default: kali-rolling)
Supported: kali-rolling kali-dev kali-last-snapshot
-k, --keep Keep intermediary build artifacts
-m, --mirror URL Mirror used to build the image (default: http://http.kali.org/kali)
-o, --output DIR Output directory (default: /home/kali/kali-installer/output)
-v, --variant VARIANT Variant of image to build (default: default)
Supported: default everything netinst purple
-x, --version VERSION What to name the image release as (default: rolling)
-h, --help Show this help and exit
Installer options:
-H, --hostname HOSTNAME Set system host name (default: kali)
-P, --packages PKGS Install extra packages (comma/space separated list)
Apt caching proxy:
Auto-detected: localhost:3142 (apt-cacher-ng), localhost:8000 (squid-deb-proxy).
If detected and http_proxy is not set, http_proxy is exported automatically.
Supported environment variables:
http_proxy HTTP proxy URL, see README.md for details
DEBUG Print extra debug output
Any --flag value can be pre-set via its env var (e.g. ARCH, BUILD_MIRROR, OUT_DIR)
Examples:
build.sh
build.sh --branch kali-rolling
build.sh -b kali-dev -v netinst -a arm64
NOTE: Three flags do not share their variable's name: --mirror is BUILD_MIRROR, --hostname is KALI_HOSTNAME (bash already sets HOSTNAME) and --output is OUT_DIR. Every other flag is its own name, upper-cased (e.g. --branch is BRANCH).