How to install Kali Linux in Virtualbox : Step By Step guide.
Hi friends, the latest version of Kali Linux 1.0.9 has been released and is available for download here. Today we are going to see how to install kali linux in VirtualBox available for download here. In this step-by-step guide, I will try to resolve all the problems faced in the installation of Kali Linux including installation of virtualbox guest additions and screen integration problems. So let’ start.
First, Let’s create a new virtual machine. Open Virtualbox and go to “Machine” and click on New or hold “CTRL+N”. The below window will pop up. Choose the name for your virtual machine. I named it Kali 1.0.9. Choose the OS type as “Linux” and version as “Debian(32 bit)” ( since I am installing 32bit version.). Click on Next.
Allot the memory of atleast 512MB. Click on Next.
Select the option “Create a virtual hard drive now”. Click on “Create“.
If you want to use your virtual machine image with other virtualization software like Vmware in future, select vmdk image otherwise select vdi image. Since I regularly use this image with Vmware also, I selected vmdk. Click on “Next“
Select the option “Dynamically allocated”. This selection allots the memory according to the requirement. Click on “Next”.
Allocate atleast 15GB of hard disk to the virtual machine. Click on “Create“.
The virtual machine is created. It’s time to boot into our operating system. Before booting into Kali Linux we need to make a few changes. Go to “Settings” as shown below.
Go to System>Processor and enable the option “Enable PAE/NX” and click on OK.
Start the virtual machine and browse to the location of the iso file of Kali Linux and click on “Start“
Select the option “Install”. Hit “Enter”
Choose the language as “English” or as applicable and select the location of your choice. I chose “India.”
Choose your keyboard.
The system will load some additional components and then prompt you for the hostname. Enter hostname and Activate the “Continue” button.
You can choose the domain name if you want. However it is optional. Activate “Continue”
The system will prompt you to set the root password. Enter the root password and click on “Continue.”
Re-enter the password to confirm. Click on “Continue.”
The system will prompt you to partition disks. If you are not sure what to do or a novice, choose “Guide-use entire disk.” option.
Confirm the disk partitioning.
Select the partitioning scheme of your choice. If you are a new user choose the first option as recommended
Then you will be given an overview of current settings. Choose the option “Finish partitioning and write changes to disk.”
Select the option “Yes” to write the changes to disk.
The installation of the system will start as shown below.
In the middle of the process, you will be prompted if you want to use a network mirror. select “No”.
In the midst of the process, you will get a blue screen as shown below for a rather long time. Don’t panic and have patience. The process will continue again by itself.
Then system will ask you whether to install the grub loader to MBR. Click “Yes” and the installation will continue.
When the installation is completed, the system will ask you to reboot into the system. click on “Continue”.
The system will reboot into the operating system as shown below. Enter the username as “root” and the password as configured previously.
Now comes the most interesting but contentious part. Yes, installation of guest additions. But don’t worry. you will have a final solution at the end of the article.
Install guest additions by going to “Devices>install guest additions”. A cd image will appear on the Kali desktop. Double click on the cd image. A message will be displayed as below. Click on “Run”.
Most probably you will get an error message as shown below.
Before we do anything, let’s alter the sources.list file. For those who don’t know, sources.list file is a file where system has list of repositories where the OS should be checking for updates or installing new programs. Open a terminal. Type the command locate sources.list to search for sources file. We are interested in the one located in the “apt” directory. We will open this file using vi editor. Type command vi /etc/apt/sources.list as shown below.
The Vi editor will open the file as shown below.
If you are new to vi editor, type i once to get into insert mode, then add the following three lines given.
deb http://http.kali.org/kali kali main non-free contrib
deb-src http://http.kali.org/ kali kali main non-free contrib
deb http://security.kali.org/kali-security kali/updates main contrib non-free
as shown below. Once you are finished, tap the esc key to get out of insert mode,then type :wq to save and exit the file. What we have just done is instructed the system to look for headers in the right place while installing guest additions.
Once you came out of the vi editor, type the command apt-get update && apt-get install -y linux-headers-$(uname -r) to install the headers.
You will see the below processes taking place.
Once it is finished, open a terminal. Type the command “pwd” to see the current directory. Navigate to the “media” directory where our virtualbox guest additions CD is mounted by typing commands “cd/” and then “cd media”. Type “ls” to see where our guest additions is mounted. It’s mounted at directory “cdrom”. Navigate to that directory by typing command “cd cdrom“. Type the command “ls” once again to see the contents of the directory.
We are interested in the file “VBoxLinuxAdditions.run”. Check the permissions of this program by typing command “ls -l VBoxLinuxAdditions.run”. We can see that the root user doesn’t have “execute” permissions on this file. First copy this file to the root directory by typing command cp VBoxLinuxAdditions.run /root. Now go to root directory by typing command cd /root. Change the permissions of this file by typing command chmod 755 VBoxLinuxAdditions.run. Now let’s check if the permissions have been changed. Type command ls -l VBoxLinuxAdditions.run. We can see below that now we have execute permissions over this file.
Now let’s run this program. Type command ./VBoxLinuxAdditions.run. Guest additions would be successfully installed as shown below. Now restart the system by typing command “shutdown -r now“.
Hope this was helpful. If you face any problems while installation, please leave a comment below.
See the video version of this howto.
Installing VirtualBox Guest Additions in Kali Linux
In order to have proper mouse and screen
integration as well as folder sharing with your host system, you will
need to install the VirtualBox Guest additions.
Once you have booted into your Kali
Linux virtual machine, open a terminal window and issue the following
command to install the Linux Kernel headers.
apt-get update && apt-get install -y linux-headers-$(uname -r)
Once this is complete you can now attach
the Guest Additions CD-Rom. This can be done by selecting ‘Devices’
from the VirtualBox Menu and selecting ‘Install Guest Additions.’ This
will mount the GuestAdditions iso to the virtual CD Drive in your Kali
Linux virtual machine. When prompted to autorun the CD, click the Cancel
button.
From a terminal window, copy the
VboxLinuxAdditions.run file from the Guest Additions CD-Rom to a path on
your local system ensure it is executable and run the file to begin
installation.
cp /media/cd-rom/VBoxLinuxAdditions.run /root/
chmod 755 /root/VBoxLinuxAdditions.run
cd /root
./VBoxLinuxAdditions.run
chmod 755 /root/VBoxLinuxAdditions.run
cd /root
./VBoxLinuxAdditions.run
Reboot the Kali Linux VM to complete
the Guest Additions installation. You should now have full mouse and
screen integration as well as the ability to share folders with the host
system.
Creating Shared Folders with the Host System
In order to share folders on your host system with your Kali Linux VM, there are a few short steps that need to be completed.
From the VirtualBox Manager, select your
Kali Linux VM instance and click on the ‘Shared Folders’ link in the
right window pane. This will launch a pop up window for adding shared
folders. Within this window click the icon to add a folder.
In the Folder Path text box, provide the
path to the folder you would like to share, or click the drop-down
arrow to browse your host system for the path. Select the check boxes
that allow for ‘Auto-mount’ and ‘Make Permanent’ and click the OK button
both times when prompted.
Your shared folders will now be
available in the media directory. You can create a bookmark or link for
easier access to the directory.
Tidak ada komentar:
Posting Komentar