Are you tired of downloading Kali Packages every-time you re-install? Kali Linux 2016.1? I know I am. The 2.6G ISO file was released back in January 2016 and since then it hasn’t been updated. This is an easy and quick way for building updated Kali Linux ISO for Kali 2016.2 and escape downloading same packages over and over and over again.
Ohh, yes, in case you missed it, Kali Linux 2016.2 has been in the wild since 2016-07-21, there just wasn’t any official announcement as it seems like an internal build-name/code. This also means, if you were like me who tries way too much and breaks system and keeps re-installing it, you are constantly doing the same apt-get update, upgrade and dist-upgrade to update you old Kali Linux 2016.1 to 2016.2. Here is the version info for Kali 2016.1
root@kali:~# cat /proc/version Linux version 4.3.0-kali1-amd64 (debian-kernel@lists.debian.org) (gcc version 5.3.1 20160101 (Debian 5.3.1-5) ) #1 SMP Debian 4.3.3-5kali4 (2016-01-13) root@kali:~#
and here’s is the version info for Kali 2016.2
root@kali:~# cat /proc/version Linux version 4.6.0-kali1-amd64 (devel@kali.org) (gcc version 5.4.0 20160609 (Debian 5.4.0-6) ) #1 SMP Debian 4.6.4-1kali1 (2016-07-21) root@kali:~#
So, Kernel is updated from 4.3.0 to 4.6.0 and build/release date is changed from (2016-01-13) to (2016-07-21). That’s 6 months worth of updates or i.e. 2 GB of download and no I am not even worried about the download. Personally, I am concerned about the time and effort. This post will also help those with slower Internet and/or download cap limited users. You do this once, keep that ISO and the only packages you will need it from that day ono. Sounds fair? I bet it does. Lets do it!
Building an updated Kali ISO is actually very easy and if you read Kali documentations, you probably do it already. If not, here’s some dot points to convince you:
- This process creates an ISO with the latest packages, so you don’t need to download any (or too many) in coming weeks.
- You can configure various desktop environments (such as KDE, Gnome, E17, I3WM, LXDE, MATE and XFCE) and create multiple ISO’s. Same deal for these ISO’s. They will have the latest and greatest packages already in.
- You can control meta-packages in your build and only download the packages you need to build your custom ISO. This fits perfectly for those who work in minimal environment or works using a particular application. Also less download, smaller ISO.
- You do use live-build hook scripts in various stages of the Kali ISO live build.
- You can include additional files or scripts in your build and create ISO with it. This helps when you are building it for a particular organization.
You can configure virtually any aspect of your Kali ISO build using the Debian live-build scripts. These scripts allow developers to easily build live system images by providing a framework that uses a configuration set to automate and customize all aspects of building the image. The Kali Linux development team has adopted these scripts and they’re used to produce the official Kali ISO releases.
Requirements
Ensure that your system meets the following requirements to avoid issues:
- About 20G free disk space.
- A decent Internet connection.
- Existing Kali environment.
Disk space seems to be the most important of all. This total process used about 17G space (I assume the system will use some swap for slower systems). You need the disk-space as this process will download all the packages, uncompress those and then create an ISO. I had around 55GB dedicated on my Samsung 850 EVO – 500GB SSD drive for Kali, so had absolutely no issues.
Getting Ready — Setting up the live-build system
We first need to prepare the Kali ISO build environment by installing and setting up live-build and its requirements with the following commands:
root@kali:~# apt-get install curl git live-build cdebootstrap
root@kali:~# git clone git://git.kali.org/live-build-config.git
Now you can simply build an updated Kali ISO by entering the live-build-config
directory and running our build.sh wrapper script, as follows:
root@kali:~# cd live-build-config
root@kali:~/live-build-config# ./build.sh --distribution kali-rolling --verbose
The build.sh
script will take a while to complete, as it downloads all of the required packages needed to create your ISO. Good time for a coffee. Yeah nah, go away for a about an hour or two.
and the final result?
root@kali:~/live-build-config# ls -ltrah images/ total 2.8G -rw-r--r-- 1 root root 2.8G Aug 4 23:18 kali-linux-rolling-amd64.iso -rw-r--r-- 1 root root 1.2M Aug 4 23:19 kali-linux-rolling-amd64.log drwxr-xr-x 12 root root 4.0K Aug 4 23:19 .. drwxr-xr-x 2 root root 4.0K Aug 4 23:19 . root@kali:~/live-build-config#
a 2.8G Kali Linux rolling ISO for 64-bit systems. Nice!!!
Building a Kali Linux ISO for Older i386 Architectures
The Kali Linux i386 ISO has PAE enabled. If you require a default kernel for older hardware with PAE disabled, you will need to rebuild a Kali Linux ISO. The rebuilding process is much the same as described above, except that the 686-pae parameter that needs to be changed to 586 in auto/config as follows. First, install the prerequisites.
apt-get install git live-build cdebootstrap debootstrap git clone git://git.kali.org/live-build-config.git
Next, make the change in auto/config
for the appropriate architecture:
cd live-build-config sed -i 's/686-pae/586/g' auto/config
Finally, run your build.
./build.sh --distribution kali-rolling --arch i386
Conclusion
I think this is a great idea. It really helps if you have a custom wifi card or hardware that requires more packages (i.e. kernel-headers and drivers etc.). You can simply bundle those in your pre-defined build and create an ISO that will just WORK without any hassle.
Thanks for reading. If you’ve found this article helpful, do bookmark and share it. Any issues, let us know via comments section. As usual, commenting doesn’t require any registration and will always remain open.
Custom Kali ISO 32 bit Mate, Xfce, KDE, Lxde, e17, i3wm
http://kali-images.cf/
http://kali-images.eu.org/
Yeah BRa!
is there is any way to make it offline
You can set up a local repo and build ISO using that but remember that you’re pretty much downloading the whole repo for that. I assume you also need to modify the scripts to make that happen. In short, I don’t think it’s viable to do it offline.
its really good
should i change the url to http://repo.kali.org???
What a great guide thanks for the info man. I do have what may be a dumb question. I made my ISO and burned to cd… is there a way to keep the files in the live-build-config updated to later make another cd?
thanks again!
Not without creating a new one, it’s the same process Live Build ISO’s are rolled out.
How to build Kali with custom directory, not default one? Is there any cmd key for specifying dir explicitly?