CS Get Started

Getting Started: Installing Kali Linux on VirtualBox

While dual-booting Kali Linux with Windows improves raw performance, it doesn’t allow instant switching between the two systems. For most learners and cybersecurity professionals, using Kali Linux in a VirtualBox (or another hypervisor) is a much better option.

Why Use a Virtual Machine?


Prerequisites

Before we begin the installation procedure, ensure you have the following ready:


Phase 1: Creating the Virtual Machine

First, we need to build the "virtual" hardware that Kali Linux will run on inside VirtualBox.

1. Open VirtualBox and click the New button at the top.
2. Write the name of the virtual machine (e.g., "Kali Linux"). Change the Type to Linux and select Debian (64-bit) as the architecture.
3. Allot the size of RAM you want to allocate to the Virtual Machine. 2048 MB (2 GB) is recommended for normal usage, but you can allocate more if your system allows it.
4. Select the option to Create a virtual hard disk now and then click on the Create button.
5. Select the Hard Disk File type. VDI (VirtualBox Disk Image) is recommended for daily purposes.
6. Select the type of Physical Hard Disk Storage. Dynamically Allocated is recommended for general purposes as it only takes up space as it fills up.
7. Select the size of your virtual hard disk (set it to at least 20 GB) and choose the location where you want to save your machine files.


Phase 2: Booting from the Kali Linux ISO

Now that the virtual hardware exists, we need to insert our "virtual installation CD" (the ISO file).

8. As soon as the VM is created, click on the Virtual machine name on the left panel, but don't start it yet. Click Settings, navigate to Storage, and click on the "Empty" disk icon.
9. Click the Browse icon (disk symbol) on the right panel, select your downloaded Kali Linux ISO file, click OK, and now click the green Start button at the top.
10. This will boot our virtual machine from the chosen Kali Linux ISO. You will see the Kali boot screen. Select the Graphical Install option and hit Enter.


Phase 3: The Graphical Installer (Basic Config)

You are now inside the actual Kali Linux setup process.

11. The first option is to select a language. Select your desired language and hit continue.
12. The next step is to select your country, territory, or area. Select your respective one.
13. Configure your keyboard keymap. Confirm the keymap you want to use (e.g., American English) and click Next.
14. It will ask for a Hostname (the name your computer goes by on the network). Enter a name like "kali" and press continue.
15. Next, enter the Domain name. You may leave it completely blank if you are installing this for personal/learning use.
16. Create a user account and enter a strong password for your Kali Linux OS, then click continue. (Do not forget this password!)
17. Select the time zone you want to use as your default.


Phase 4: Disk Partitioning

Partitioning tells Kali Linux how to format and organize the virtual hard drive we created in Phase 1.

Note: If you are an absolute beginner, selecting "Guided - use entire disk" is highly recommended over the Manual method. However, below are the manual steps if you wish to customize it.

18. Click on the "Manual" option and press continue.
19. Select the Free Space on your virtual drive and choose to create a new partition. It is recommended for new users not to use separate partitions for root, home, and swap areas. Just put everything in one partition.
20. Click on Create a new partition.
21. Enter the partition size to be created (use the maximum available).
22. Select the partition type as “Logical” or "Primary".
23. Use the default settings for the partition (Mount point: /, File system: ext4). Click on "Done setting up the partition".
24. Scroll down, select "Finish partitioning and write changes to disk", and click continue.
25. A prompt will appear asking to verify. Select the "no" option if you need to go back, otherwise...
26. Select the "yes" option to confirm writing changes to the disk, and click continue.


Phase 5: Finalizing Installation & GRUB

With the disk formatted, the core system files will now be copied over.

27. Wait for a few minutes. The setup will now install the base Kali system and software packages into your Virtual Machine.
28. Towards the end, it will ask whether to install the GRUB boot loader to the master boot record. You must click Yes to make the system bootable.
29. Choose your respective virtual hard disk (usually /dev/sda) from the list of devices to install GRUB onto.
30. The installation will complete its final steps. This will take a few more minutes.
31. Once the complete process is finished successfully, click Continue. It will automatically restart the virtual machine, eject the virtual ISO, and boot into your brand new Kali Linux OS!
32. In order to close the Virtual Machine when you are done learning, simply use the Shutdown option inside the Kali Linux OS. This action will safely and automatically terminate the VirtualBox window.


Exercise

?

Why is it recommended to use a hypervisor like VirtualBox instead of dual-booting?