2.2. Booting a Kali ISO Image in Live Mode
2.2.1. On a Real Computer
As a prerequisite, you need either a USB key prepared (as detailed in the previous section) or a DVD-ROM burned with a Kali Linux ISO image.
The BIOS/UEFI is responsible for the early boot process and can be configured through a piece of software called Setup. In particular, it allows users to choose which boot device is preferred. In this case, you want to select either the DVD-ROM drive or USB drive, depending on which device you have created. Depending on your BIOS/UEFI, you may have a one time boot menu option, allowing to temporarily change the boot order.\
Starting Setup usually involves pressing a particular key very soon after the computer is powered on. This key is often Delete or Escape, and sometimes F2, F8, F10 or F12. Most of the time, the choice is briefly flashed onscreen when the computer powers on, before the operating system loads.
Once the BIOS/UEFI has been properly configured to boot from your device, booting Kali Linux is simply a matter of inserting the DVD-ROM or plugging in the USB drive and powering on the computer.
2.2.2. In a Virtual Machine
Virtual machines have multiple benefits for Kali Linux users. They are especially useful if you want to try out Kali Linux but aren't ready to commit to installing it permanently on your machine or if you have a powerful system and want to run multiple operating systems simultaneously. This is a popular choice for many penetration testers and security professionals who need to use the wide range of tools available in Kali Linux but still want to have full access to their primary operating system. This also provides them with the ability to archive or securely delete the virtual machine and any client data it may contain rather than reinstalling their entire operating system.
The snapshot features of virtualization software also make it easy to experiment with potentially dangerous operations, such as malware analysis, while allowing for an easy way out by restoring a previous snapshot.
There are many virtualization tools available for all major operating systems, including VirtualBox®, VMware Workstation®, Xen, KVM, and Hyper-V to name a few. Ultimately, you will use the one that best suits you but we will cover the two most frequently-used in a desktop context: VirtualBox® and VMware Workstation®, both running on Microsoft Windows 10. If you don't have corporate policy constraints or personal preference, our recommendation is that you try out VirtualBox first, as it is free, works well, is (mostly) open-source, and is available for most operating systems.
For the next sections, we will assume that you have already installed the appropriate virtualization tool and are familiar with its operation.
220.127.116.11. Preliminary Remarks
To fully benefit from virtualization, you should have a CPU with the appropriate virtualization features and they should not be disabled by the BIOS/UEFI. Double check for any “Intel® Virtualization Technology” and/or “Intel® VT-d Feature” options in the machine's Setup screens.
You should also have a 64-bit host operating system, such as
amd64 architecture for Debian-based Linux distributions,
x86_64 architecture for RedHat-based Linux distributions, and
64-bit for Microsoft Windows.
If you lack any of the prerequisites, either the virtualization tool will not work properly or it will be restricted to running only 32-bit guest operating systems.
Since virtualization tools hook into the host operating system and hardware at a low level, there are often incompatibilities between them. Do not expect these tools to run well at the same time. Also, Microsoft Windows users beware that professional editions or higher come with Hyper-V installed and enabled, which might interfere with your virtualization tool of choice. To turn it off, execute “Turn Windows features on or off” from Windows Settings.
After the initial installation, VirtualBox's main screen looks something like Figure 2.6, “VirtualBox's Start Screen”.
Figure 2.6. VirtualBox's Start Screen
Click on New (Figure 2.7, “Name and Operating System”) to start a wizard that will guide you through the multiple steps required to input all the parameters of the new virtual machine.
Figure 2.7. Name and Operating System
In the first step, shown in Figure 2.7, “Name and Operating System”, you must assign a name to your new virtual machine. We will use “Kali Linux.” You must also indicate what kind of operating system will be used. Since Kali Linux is based on Debian GNU/Linux, select "Linux" for the type and "Debian (32-bit)" or "Debian (64-bit)" for the version. Although any other Linux version will most likely work, this will help distinguish between the various virtual machines that you might have installed.
Figure 2.8. Memory Size
In the second step, you must decide how much memory to allocate to the virtual machine. While the recommended size of 1024 MB is acceptable for a Debian virtual machine acting as a server, it is definitely not enough to run a Kali desktop system, especially not for a Kali Linux live system, as the live system uses memory to store changes made to the file system. We recommend increasing the value to 1500 MB (Figure 2.8, “Memory Size”) and highly recommend that you allocate no less than 2048 MB of RAM. For more information, see Section ">4.1, “Minimal Installation Requirements”.
Figure 2.9. Hard disk
In the third step (shown in Figure 2.9, “Hard disk”), you are prompted to choose a physical or virtual hard disk for your new virtual machine. Although a hard disk is not required to run Kali Linux as a live system, add one for when we demonstrate the installation procedure later, in Chapter 4, Installing Kali Linux.
Figure 2.10. Hard Disk File Type
The content of the hard disk of the virtual machine is stored on the host machine as a file. VirtualBox is able to store the contents of the hard disk using multiple formats (shown in Figure 2.10, “Hard Disk File Type”): the default (VDI) corresponds to VirtualBox's native format; VMDK is the format used by VMware. Keep the default value, because you don't have any reason to change it. The ability to use multiple formats is interesting mainly when you want to move a virtual machine from one virtualization tool to another.
Figure 2.11. Storage on Physical Hard Disk
The explanation text in Figure 2.11, “Storage on Physical Hard Disk” clearly describes the advantages and drawbacks of dynamic and fixed disk allocation. In this example, we accept the default selection (Dynamically allocated), since we are using a laptop with SSD disks. We don't want to waste space and won't need the extra bit of performance as the machine is already quite fast to begin with.
Figure 2.12. File Location and Size
The default hard disk size of 20 GB shown in Figure 2.12, "File Location and Size" is enough for a standard installation of Kali Linux, so we will not change it. For more information about Kali's requirements see Section 4.1, "Minimal Installation Requirements". You can also tweak the name and the location of the disk image. This can be handy when you don't have enough space on your hard disk, allowing you to store the disk image on an external drive.
Figure 2.13. The New Virtual Machine Appears in the List
The virtual machine has been created but you can't really run it yet, because there is no operating system installed. You also have some settings to tweak. Click on Settings on the VM Manager screen and let's review some of the most useful settings.
Figure 2.14. Storage Settings
In the Storage screen (Figure 2.14, “Storage Settings”), you should associate the Kali Linux ISO image with the virtual CD/DVD-ROM reader. First, select the CD-ROM drive in the Storage Tree list and then click on the small CD-ROM icon on the right to display a contextual menu where you can Choose Virtual Optical Disk File....
Figure 2.15. System Settings: Motherboard
In the System screen (Figure 2.15, "System Settings: Motherboard"), you will find a Motherboard tab. Make sure that the boot order indicates that the system will first try to boot from any optical device before trying a hard disk. This is also the tab where you can alter the amount of memory allocated to the virtual machine, should the need arise.
Figure 2.16. System Settings: Processor
In the same screen but on the “Processor” tab (Figure 2.16, “System Settings: Processor”), you can adjust the number of processors assigned to the virtual machine. Most importantly, if you use a 32-bit image, enable PAE/NX or the Kali image will not boot since the default kernel variant used by Kali for i386 (aptly named “686-pae”) is compiled in a way that requires Physical Address Extension (PAE) support in the CPU.
There are many other parameters that can be configured, like the network setup (defining how the traffic on the network card is handled), but the above changes are sufficient to be able to boot a working Kali Linux live system. Finally, click Boot and the virtual machine should boot properly, as shown in Figure 2.17, “Kali Linux Boot Screen in VirtualBox”. If not, carefully review all settings and try again.
Figure 2.17. Kali Linux Boot Screen in VirtualBox
VMware Workstation is very similar to VirtualBox in terms of features and user interface, because they are both designed primarily for desktop usage, but the setup process for a new virtual machine is a bit different. We will be using VMware Workstation Pro edition.
Figure 2.18. VMware Start Screen
The initial screen, shown in Figure 2.18, “VMware Start Screen”, displays a big Create a New Virtual Machine button that starts a wizard to guide you through the creation of your virtual machine.
Figure 2.19. New virtual Machine Wizard
In the first step, you must decide whether you want to be presented with advanced settings during the setup process. In this example, there are no special requirements so choose the typical installation, as shown in Figure 2.19, “New virtual Machine Wizard”.
Figure 2.20. Guest Operating System Installation
The wizard assumes that you want to install the operating system immediately and asks you to select the ISO image containing the installation program (Figure 2.20, “Guest Operating System Installation”). Select “Installer disc image file (iso)” and click on Browse to select the image file.
Figure 2.21. Select a Guest Operating System
When the operating system cannot be detected from the selected ISO image, the wizard asks you which guest OS type you intend to run. You should select “Linux” for the OS and “Debian 10.x 64-bit” for the version, as shown in Figure 2.21, “Select a Guest Operating System”. We select "Debian 10.x" due to Kali Linux being constantly updated to the newest version of Debian.
Figure 2.22. Name the Virtual Machine
We have chosen Kali Linux as the name of the new virtual machine (Figure 2.22, "Name the Virtual Machine"). As with VirtualBox, you also have the option to store the VM files in an alternate location.
Figure 2.23. Specify Disk Capacity
The default hard disk size of 20 GB (Figure 2.23, “Specify Disk Capacity”) is usually sufficient but you can adjust it here depending on your expected needs. As opposed to VirtualBox, which can use a single file of varying size, VMware has the ability to store the disk's content over multiple files. In both cases, the goal is to conserve the host's disk space.
Figure 2.24. Ready to Create Virtual Machine
VMware Workstation is now configured to create the new virtual machine. It displays a summary of the choices made so that you can double-check everything before creating the machine. Notice that the wizard opted to allocate 2048 MB of RAM to the virtual machine, which is sufficient for our needs. If the allocated value is lower, that is not enough so click on Customize Hardware... (Figure 2.24, "Ready to Create Virtual Machine") and tweak the Memory setting, as shown in Figure 2.25, "Configure Hardware Window".
Figure 2.25. Configure Hardware Window
After a last click on Finish (Figure 2.24, “Ready to Create Virtual Machine”), the virtual machine is now configured and can be started by clicking "Power on this virtual machine” as shown in Figure 2.26, “Kali Linux Virtual Machine Ready”.
Figure 2.26. Kali Linux Virtual Machine Ready