Build Kali Linux with Live-Build on Debian-based Distros

Offensive Security use live-build to create their official Kali Linux releases and they encourage users to jump in and build customized versions of Kali Linux whenever users can. The documentation of the process is one of the most popular items on their documentations website, and the Kali Dojo also revolves around this topic. Offensive Security love it and our users love it.

One roadblock of live-build has always been the fact that you need a Kali Linux system to build a Kali Linux system. The reason for this is that small changes in both the original debootstrap and live-build packages are needed for building a Kali Linux ISO. In Kali Linux, these changes are already included, however in most Debian derivatives, some gentle massaging is needed to get ISOs to build.

Today, Offensive Security has updated their docs site to include instructions on how to build a custom Kali Linux ISO on other Debian-based distros like Debian 9 or Ubuntu 16.04 and 18.04. This will hopefully allow users running Debian derivatives to test the waters with Kali Linux and play with one of its cooler features.

Building a custom Kali Linux release with live-build is not as scary as it might sound so be sure to give it a chance!

Building Kali Linux on orther Debian-based Distros:
   You can easily run live-build on Debian based systems other than Kali Linux. The instructions below have been tested to work with both Debian and Ubuntu.

   First, we prep the system by ensuring it is fully updated, then proceed to download the Kali Linux archive keyring and live-build packages. The latest versions of these packages can always be found at https://http.kali.org/pool/main/k/kali-archive-keyring/ and https://archive.kali.org/kali/pool/main/l/live-build/ respectively.

   Open Terminal and enter the following commands:
   
   With that completed, we install some additional dependencies and the previously downloaded files:   With the environment all prepared, we start the live-build process by setting up the build script and checking out the build config.



   At this point, we have to edit the build.sh script to bypass a version check. We do this by commenting out the “exit 1” below.
   With that change made, the script should look as follows:

   We can now build our ISO as normal:
      sudo ./build.sh --variant light --verbose

No Commitment Testing
   After you get Kali Linux built, you might want to quickly test the ISO you created. There is a fast no commitment trial you can do with QEMU. On Ubuntu, you just have to prep the system by installing a few packages:
   With that out of the way, we will create a dynamic disk image to hold our Kali Linux installation and then boot off our newly created ISO. Don’t worry about the disk size, it will grow as needed so you won’t suddenly fill your drive just by creating the disk:

Build Kali Linux with Live-Build on Debian Based Systems
Kali Linux Live-build on Debian Distros
   At this point, you can run a live instance of Kali Linux, or install it to the virtual disk. If we go ahead and install it, we would then later launch the newly created VM with the command:
      kvm --name Kali -m 1024 -hda kali-disk.img -boot c

There are few things as satisfying as running your own Linux distros install that you created and tweaked for what you need. With a way to build Kali Linux on other Debian based distros and a quick way to test it, why wait?