Installing KALI LINUX on a Virtual Machine [A Step by Step Guide]

Written by guiguibashow | Published 2019/10/18
Tech Story Tags: kali-linux | virtual-machine | virtual-box | ethical-hacking | penetration-testing | offensive-security | technology | latest-tech-stories

TLDR In this tutorial we are going to assume that you do not have a dedicated computer to run Kali Linux (or any other linux distribution) We will run it from a virtualised environment, which is the equivalent of a "Virtual PC" In order to begin with, you should already have virtual box installed on your machine. If not, head to Virtual Box and download the latest version of this software (this is free) This software is going to emulate the hardware in which we are running Kali Linux. Once that is done, we will mount the ISO image into the virtual machine.via the TL;DR App

There are a number of ways that you can use to run a different operational systems in the same hardware that you currently have. DVDs, USBs and hard disks are some of the options that you could go for. In this tutorial we are going to assume that you do not have a dedicated computer to run Kali Linux (or any other linux distribution), and therefore we will run it from a virtualised environment, which is the equivalent of a "Virtual PC".
In order to begin with, you should already have virtual box installed on your machine. If not, head to Virtual Box and download the latest version of this software (this is free). This software is going to emulate the hardware in which we are going to install Kali.
In case you are using a Mac machine and encounter some issues (which is normal), feel free to visit my profile page where I have covered how to fix some of the errors.
Research shows that it is pretty damn hard to install software, unless you have access to that software. So as a first step we are going to make a road trip to the official download page for the Kali Linux ISO image.
By the way, if some of the terms like "ISO image" scare you, don't be afraid to make a quick stop on wikipedia. That will greatly reduce your learning curve. As a gesture of good will I have linked the wikipedia ISO explanation for you here, but do not get used being spoiled. As the latin saying goes
"Rome was not built in a day".
That pretty much means that as a security enthusiast you will have to get used to doing your own research.
Going forward, in this demo we are going to use the Kali Linux KDE 64-bit flavour, in case you want to mirror that and follow along. That has a download size of about 3.2 GB, and might take quite a while to download. Once that is done, we are going to mount the .ISO image into the virtual machine.
You could burn it into a bootable DVD or USB if you intend to use it in a different machine but there are a few considerations that you need to take into account which we will not cover in this tutorial.
Once the the image is downloaded we are going to open up Virtual Box (I am running version 6.0.6 as you can see below).
The first thing we are going to do is create a brand new virtual machine by clicking on new.
Now we are going to specify where the files of the service files for this machine are going to exist in the native operational system. In this case, I created a folder in my mother's laptop :( (that's all I have at the time of writing) and I called this machine Hackernoon Demo.
Since Kali is built on top Linux, we are going to choose Linux for type, and we will go with Ubuntu (64-bit) for version. Specifying the type and version does not guarantee that this will be perfect for you, but that is good default setting for us to get Kali up and running on VirtualBox.
We will click on next, and we will be asked how much memory we want to give to this big boy. Here we will be giving it 2GB, since it is only a demo, but if you were to give it 1GB it's very likely that it should still work. In case you have plenty of memory, just go ahead and give it as much as you would like.
In the next step, VirtualBox will ask you how you want to set up your hard drive. You can either create one or use an existing one, but in this case we are going to create a new hard drive.
We will then choose the hard drive file types, and we will choose VirtualBox Disk Image so that we do not need to go back and forth between different emulators. As an example, VHD would be more suitable if you were using VMWare (a virtualisation tool from a different vendor).
Then we will need to choose how to allocate storage on the physical hard drive. I am going to go ahead and choose dynamic allocation.
In the next step you are going to choose how much storage you want to allocate to this machine. Before doing this, it is a good idea to check how much memory you have available. In this demo I am going to give it 10 GB.
Inside VirtualBox you can specify where you want virtual disks to be kept. I keep mine on an external 2TB hard drive when I am not in my mom's computer, of course. Then we are going to click on create, but hold your horses because we are not done yet.
Let's move on and play with the main settings in order to make sure we can understand them. This will be important to give you some independence in dealing with virtual environments in the future. Settings for virtual machines are a big topic and you can expect further coverage of this topic in other articles.
Under general we have items that we have already covered during the creation process, so I will move on to system settings.
Under system I am going to remove floppy because I do not have a floppy drive, and in the boot order I am going to say that VirtualBox should check for any media in the DVD player first, because that is where our Kali image is going to be sitting for the initial install. I will leave the base memory at 2MB, but you can also change that later, if necessary. Make sure you mirror the extended features as per the above image.
We will then move on to Display, where we will kick the video memory all the way up to 128MB, and we will also enable 3D acceleration in case we want to get naughty with some graphics. If you running on old hardware make sure you do not give it too much video memory or you run the risk of burning some circuitry.
After that, we will check storage which is one of the most important settings (but not the most important in my opinion). As you can see below, we have an empty CD-ROM (optical) drive.
We want to make sure that we point this empty CD-ROM drive to the image file that we have previously downloaded from the Kali Linux official page, and we will do that by clicking on the disc icon under attributes so that we are given the options to select our .ISO file.
Now that drive represents the .ISO image, and it believe that the CD-ROM is mounted. Notice that we will not tick the live CD/DVD checkbox, and we will leave it as default.
Moving on, let's check the settings for network, which is the main configuration that we have to pay attention to (in my personal opinion), and where I have struggled the most when playing around depending on the scenario.
It turns out that every detail matters in case you are trying to set up internet connection. Each of the networking adapters can be separately configured to operate in one of the following modes:
  1. Not attached
  2. Network Address Translation (NAT)
  3. NAT network
  4. Bridged networking
  5. Internal networking
  6. Host-only networking
  7. Generic networking
For more information on each mode you can check the documentation (don't be scared, it doesn't bite).
If all you want is to browse the Web, download files, and view email inside the guest, then this default mode should be sufficient, provided you have a wired internet connection.
On my website and in other articles we will also be talking about bridged networking, which is ideal for more advanced networking needs, and which is necessary for certain actions such as uncovering hidden SSIDs, networking simulations and running servers in a guest.
So we will go ahead and use NAT for now, as this is a newbie article. Make sure you mirror the following image below. If you are connected via an ethernet cable everything should work just fine when you launch the machine. In case you do not have a wired connection you will not be able to reach the web without an interface card.
If all you wanted at this point in time was to run Kali on a virtual environment, you just need to click start to launch the OS.
In the following articles and on my website I will be covering how to use network adapters so that you have an exit node to the internet even if you do not have an ethernet connection available.
Feel free to get in touch and rest assured that this is just the warm up, if you intend to join the cyber army forces.

Written by guiguibashow | N/a
Published by HackerNoon on 2019/10/18