Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali...

28
NAKIVO Blog > VirtualBox Administration and Backup > How to Install Kali Linux on VirtualBox: Complete Walkthrough June 26, 2019 Kali Linux is a Debian-based Linux distribution developed for penetration testing, and is especially useful for security specialists and enthusiasts. Kali Linux, formerly known as BackTrack Linux, includes a lot of tools and applications for network audits. Kali can be run as a Live DVD, and can be installed on a computer as a host operating system (OS) as any other Linux. However, it is not recommended that you use Kali as a general purpose desktop operating system. At the same time, when using Kali Live DVD, settings are not saved after a system reboot. In this situation, virtual machines can be of great help. Today’s blog post explores how to install Kali Linux on VirtualBox as a virtual machine (VM). The advantages of installing Kali Linux on VirtualBox are: By running multiple operating systems simultaneously (a host OS and a guest OS or multiple guests), you don’t need to reboot a computer as when using dual boot. How to Install Kali Linux on VirtualBox: Complete Walkthrough Unknown date Michael Bose How to Install Kali Linux on VirtualBox: An Expert Guide

Transcript of Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali...

Page 1: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

NAKIVO Blog > VirtualBox Administration and Backup > How to InstallKali Linux on VirtualBox: Complete Walkthrough

June 26, 2019

Kali Linux is a Debian-based Linux distribution developed forpenetration testing, and is especially useful for security specialists andenthusiasts. Kali Linux, formerly known as BackTrack Linux, includes alot of tools and applications for network audits. Kali can be run as a LiveDVD, and can be installed on a computer as a host operating system(OS) as any other Linux. However, it is not recommended that you useKali as a general purpose desktop operating system. At the same time,when using Kali Live DVD, settings are not saved after a system reboot.In this situation, virtual machines can be of great help. Today’s blogpost explores how to install Kali Linux on VirtualBox as a virtualmachine (VM).

The advantages of installing Kali Linux on VirtualBox are:

By running multiple operating systems simultaneously (a host OSand a guest OS or multiple guests), you don’t need to reboot acomputer as when using dual boot.

How to Install Kali Linux on VirtualBox:Complete Walkthrough

Unknown date Michael Bose

How to Install Kali Linux on VirtualBox: AnExpert Guide

Page 2: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

A VM running Kali Linux is isolated from your host OS - runningKali on a VM in an isolated environment is secure.

You can take a snapshot and roll back to the previous VM state ifsomething goes wrong. The risk of harm to Kali Linux on a VM isminimal as a result.

You can copy a con�gured VM on which Kali Linux is installed toother computers.

You can attach physical USB devices, such as external networkadapters directly to a VM due to the VirtualBox USB pass-throughfeature.

Make sure that VirtualBox is installed on your host operating systembefore continuing, using the latest VirtualBox version if possible.Please install VirtualBox Extension Pack on your host machine to usesome advanced features such as USB pass-through. In the today’s blogpost, you will learn how to install Kali Linux on VirtualBox on Windows10. If you wish to know how to install Kali Linux on VirtualBox on Mac,don’t worry – the installation principle is the same, due to theuniversality and multiplatform nature of VirtualBox. The installationalgorithm is similar as that for installing Ubuntu on VirtualBox.

Downloading the Installation Image of Kali Linux

First, go to the o�cial web site and download the ISO image of KaliLinux. There are multiple 32-bit and 64-bit images that have di�erentgraphical user interfaces (Gnome, KDE, XFCE, LXDE etc.). Let’sdownload Kali Linux 64-bit v.2019.2 – this distribution has Gnome as agraphical user interface (GUI). You can download images via HTTP andTorrent protocols. Save the ISO �le to a custom folder, forexample, C:\VirtualBox\kali-linux-2019.2-amd64.iso. You can alsoverify the SHA256 check sum to make sure that your image isconsistent after �nishing downloading.

Page 3: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Creating a New VM

Once you have downloaded the installation image, you can create a newVM. Open VirtualBox and create a new VM (Machine > New or Ctrl+N)on which Kali Linux will be installed.

Set the following VM parameters:

Name: Kali_x64

Machine Folder: C:\Virtual\VirtualBox (This path is used only for demopurpose. Try not to use a system partition to store VMs).

Type: Linux

Version: Debian (64-bit)

Memory size: 4096 MB. The VM memory size must be large enough torun a guest OS though you should leave enough unallocated memory to

Page 4: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

run your host OS. In the current example, a host machine with 16 GB ofRAM is used, which provides enough memory left for a host OS.

Hard disk: Create a virtual hard disk now.

Hit Create to continue and con�gure a new virtual hard disk.

Set the virtual disk �le location, forexample C:\Virtual\VirtualBox\Kali_x6Kali_x64.vdi

It is recommended that you store virtual disk �les in the VM folder(such folder is selected by default).

Set the virtual disk �le size. It should be at least 20 GB.

Hard disk �le type: VDI. A native VirtualBox format is selected.

Storage on physical disk: Dynamically allocated (the analog of thinprovisioning in VMware)

Page 5: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Click Create to �nish creating a new VM.

After creating a new VM, some additional settings must be con�gured.Select your recently created virtual machine and open the VM settings.

Display options

Go to Display > Screen and set Video Memory to 128 MB. It will preventinstaller hanging.

Page 6: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Next, tick the checkbox Enable 3D acceleration (optional). It will beuseful for applications that need 3D acceleration.

Network options

Next, go to the network settings and select the networking mode of thevirtual network adapter of the VM. Let’s select the Bridged mode to usethe VM network adapter much as you would for a physical networkadapter of the host machine. In this case, the VM network adapter isconnected to the same physical network as the host machine. You canset additional options such as network adapter name, type, MACaddress etc.

Page 7: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Boot options

You have to insert your virtual ISO DVD image to a virtual DVD drive ofthe VM and then boot a virtual machine from that ISO disk. In the VMsettings, go to Storage, select an IDE controller of your virtual opticaldrive (it is empty by default). Click the empty status, then click the discicon near IDE Secondary Master and in the opened menu, select ChooseVirtual Optical Disk File. Browse the Kali Linux installation ISO imagethat you have downloaded from the o�cial site before (kali-linux-2019.2-amd64.iso). Hit OK to save settings.

Page 8: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

The Step-By-Step Process of Installing Kali Linux onVirtualBox

Now you can start your new VM (Kali_x64 in this case) and begin theKali installation.

After booting from a virtual DVD, you will see a boot menu where youcan select boot options for Kali Linux such as Boot from LiveDVD, Install, Graphical Install etc. Let’s select Graphical Install.Press Enter to continue.

Page 9: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Select a language. Choose the language you wish to use for theinstallation process and the installed system. English is selected for thecurrent installation. Click the Continue button on each screen to moveforward.

Page 10: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Select your location. This option is used to set your time zone, timeformat, etc. United States has been selected in the current example.

Page 11: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Con�gure the keyboard. Select your keyboard layout. American Englishis used for the current installation.

Con�gure the network. Enter the hostname for your Linux system, forexample, kali-virtualbox.

Con�gure the domain name. If you don’t use a domain in your network,you may leave this �eld empty.

Page 12: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Set up users and passwords. Read the useful tips on this screen andenter the password for root.

Con�gure the clock. Now you can select a precise time zone for yourcountry.

Page 13: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Partition disks. You can use manual and guided partitioning of disks.For the �rst time, you can select Guided – use entire disk. The entiredisk will be used for creating one big partition.

Con�rm that you want to erase the disk. There is no reason to worry, asin this case, the empty 20-GB virtual disk is used for partitioning.

Select a preferred partitioning scheme for your virtual disk. Let’sselect All �les in one partition.

Page 14: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Check the overview and select Finish partitioning and write changes todisk.

Select Yes and con�rm that you would like to write changes to the disk.

Page 15: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Wait for the system to be installed. As Kali Linux is being installed, the�les are being copied to the virtual disk of the VM.

Con�gure the package manager. Click Yes if you would like to use anetwork mirror. Selecting this option will allow you to install or updateapplication packages from online software repositories.

Enter the information about your proxy server if you use a proxy serverfor internet access from your network. There is no proxy server in thisexample; so this �eld is left empty.

Install the GRUB boot loader on a hard disk. Since there is no otheri d b l d i l di k i i

Page 16: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

install GRUB in this case. Select Yes to install GRUB.

Select a disk to which GRUB must be installed. In this case, /dev/sda isthe necessary disk and is the only disk connected to a VM.

Finish the installation. When the installation of Kali Linux onVirtualBox is complete, you will see a noti�cation message. Now youcan reboot the virtual machine to boot the Kali Linux installed on theVirtualBox VM.

After the reboot, you will see a login screen of Kali Linux. Enter root asa user name, then enter the password set during installing Kali Linuxon VirtualBox to sign in

Page 17: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Now you should see the Gnome desktop of Kali Linux installed on yourVirtualBox virtual machine.

Installing VirtualBox Guest Additions on Kali Linux

You can install VirtualBox guest additions by inserting the ISO imagelocated in the VirtualBox installation folder by default, or you caninstall Guest Additions from online Linux repositories by using yourLinux package manager.

Update the package repositories tree.

apt-get update

Page 18: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

apt-get install -y virtualbox-guest-x11

After that, you should reboot the machine.

init 6

Verify that VirtualBox Guest Additions have been installed successfully.Check the VirtualBox Guest Additions version by getting informationabout the appropriate Linux kernel module. In order to see generalinformation about the vboxguest module, use the command:

modinfo vboxguest

If you want to see the version of VirtualBox Guest Additions only, use:

lsmod | grep -io vboxguest | xargs modinfo | grep -iw version

After installing VirtualBox Guest Additions on a VM, go to VM settings> General > Advanced and enable shared clipboard and Drag n Drop inthe bidirectional mode.

Page 19: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Connecting the USB Wi-Fi Adapter to the Kali Linux VMin VirtualBox

After making the general VM con�guration, let’s connect an externalUSB Wi-Fi network adapter to the VirtualBox VM running Kali Linux.You will be able to use all the advantages of the physical USB Wi-Fiadapter in the VM running Kali to make the audit of wireless networks.VirtualBox Extension Pack must be installed to continue con�guringthe VM.

Insert your USB Wi-Fi adapter to the USB port of your physicalcomputer. Open VM settings and go to the USB section. Tick thecheckbox Enable USB Controller, Select USB 2.0 (EHCI) Controller (theWi-Fi adapter used in the current example has USB 2.0 interface).Then, add the plus icon and select the necessary USB device from thelist of USB devices connected to your host machine. Later, you canuntick the checkbox near the added USB device if that device does notneed to be attached to the VM.

Page 20: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Start your Kali_x64 VM and login to Kali Linux. Open console(Terminal) and run the command to check your network interfaces andtheir con�guration.

ifcon�g

The USB Wi-Fi adapter is connected and the name of its interfaceis wlan0. Let’s change the MAC address to go unnoticed.

Shutdown the Wi-Fi network interface.

ifcon�g wlan0 down

Change the MAC address of the wireless network adapter – set therandom MAC address with macchanger.

macchanger -r wlan0

Enable the wlan0 network interface

Page 21: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

ifcon�g wlan0 up

Check whether the MAC address of your Wi-Fi network interface hasbeen changed.

macchanger -s wlan0

ifcon�g wlan0

The MAC address has been changed successfully.

Enable the monitor mode for your wireless network interfacewith airmon-ng (by default a Wi-Fi adapter works in the managedmode). The monitor mode is required for security testing of Wi-Finetworks.

airmon-ng start wlan0

If there are any processes that could cause trouble, kill them with thecommand:

airmon-ng check kill

After that run the airmon-ng start wlan0 command once again.

Page 22: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

After starting the monitoring mode, a virtual wlan0mon networkinterface is created. You can also change the MAC address ofthe wlan0mon network interface to a random MAC address.

ifcon�g wlan0mon down

macchanger -r wlan0mon

ifcon�g wlan0mon up

Now run the airodump-ng utility to view the networks which signallevel allow to test them.

airodump-ng wlan0mon

As you can see on the screenshot below, a physical USB Wi-Fi adapterconnected to the virtual machine running Kali Linux works �ne. Wi-Fiaccess points and associated clients are displayed in the console.

Page 23: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Now that you know how to Install Kali Linux on VirtualBox manuallyand how to con�gure a wireless network adapter for using it in KaliLinux, you can continue testing Wi-Fi networks but furthercon�guration of Kali Linux for testing wireless networks is out of scopefor today’s blog post.

How to Install Kali Linux on VirtualBox with an OVATemplate

In the sections above, manual installation of Kali Linux on VirtualBoxVMs was explained. There is one more method you can use to installKali Linux on VirtualBox VMs – deploying an OVA template. DeployingVMs from VM templates has a list of advantages – you can deploymultiple similar pre-con�gured VMs from the template and save thetime otherwise needed to install an operating system and applications.There are o�cial pre-con�gured OVA images (templates) of Kali Linuxcreated by O�ensive Security team (Kali development team) for

Page 24: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Download the appropriate OVA template from the o�cial O�ensiveSecurity web site. In this example, the Kali Linux VirtualBox 64-bitOVA image is downloaded.

Open VirtualBox, open Tools and click Import.

The Import Virtual Appliance wizard is opened. Browse yourdownloaded OVA template. In this case the name of the template �leis kali-linux-2019.2-vbox-and64.ova. Hit Next to continue.

Page 25: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Set the virtual machine parameters by double-clicking the necessaryparameter. The default VM name is Kali-Linux-2019.2-vbox-amd64 inthe current example.

De�ne the directory in which a VM must be deployed from thetemplate.

Select Generate new MAC addresses for all network adapters.

Tick the checkbox Import hard drives as VDI. When all VM parametersare set, click Import.

Page 26: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Wait for a while until the VM is imported. Then select your Kali VMdeployed on VirtualBox from the template and hit Start.

Page 27: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

The default login is root and the default password is toor for Kali Linuxinstalled on VirtualBox from the template. VirtualBox Guest Additionsare pre-installed in this case. You can use a VM with Kali Linuxdeployed from a VM template similarly as you use the Kali Linux VMyou have created and con�gured manually on VirtualBox.

Data Protection with NAKIVO Backup & Replication

NAKIVO Backup & Replication delivers high-end data protection forSMBs and enterprises with multiple backup, replication and recoveryfeatures, including VMware Backup, Hyper-V Backup, O�ce 365Backup and more.

Conclusion

Installing Kali Linux on VirtualBox is not a di�cult process, but doesinclude a set of crucial features that you need to know. Today’s blogpost has explored how to install Kali Linux on VirtualBox as a VMmanually and by using an OVA VirtualBox VM template. Manualinstallation allows you to select your favorite Linux graphical userinterface (GUI) as well as con�gure all necessary parameters such asvirtual disk size, disk partitioning etc.

Page 28: Expert Guide How to Install Kali Linux on VirtualBox: Anjmarty/courses... · 26/06/2019  · Kali Linux is a Debian-based Linux distribution developed for. penetration testing, and

Semi-automatic installation of Kali on VirtualBox by using the VMtemplate helps you save time, allows you to set the main VM optionsand deploy multiple similar VMs in a short time. You can install KaliLinux on VirtualBox on your laptop, attach an external USB wirelessnetwork adapter to the VM, and perform security testing, auditing Wi-Fi networks, and many other penetration testing tasks. You can easilyswitch between your host OS and Kali Linux (guest OS). Kali Linux onVirtualBox VM is isolated, meaning that you can have an adequate levelof security and never need to worry about your host OS being accessiblefrom the outside during penetration testing with Kali. You are welcometo continue learning about this topic by reading our blog postabout installing Kali Linux on VMware VMs.

How to Install Kali Linux on VirtualBox: Complete Walkthrough4.7 (93.91%) 23 votes

Viewed using Just Read