This article will set up and configure Kali Linux 2024 on a new virtual machine using the Oracle VM VirtualBox virtualization program. This will enable you to create virtual machines and run and use Windows, Linux, or macOS systems virtually on your Windows 10 64 Bit or Windows 11 operating system computer. Following the stages abstracted in this article, you can start with Kali Linux and begin exploring its many features and capabilities.
How to Set Up Kali Linux 2024 on a New Virtual Machine using Oracle VM VirtualBox on Windows 11 & 10
Kali Linux is a distribution widely preferred by people who want to improve themselves in cybersecurity. This is because it includes various software mainly related to the system and network security for free.
Using this software, users can analyze system security vulnerabilities in their home or corporate network and take measures to ensure information security.
Kali distribution is not only used in the field of cyber security. It can also be preferred over Microsoft’s Windows system on personal computers so users can have multiple powerful tools.
Suppose you find the need for an alternative operating system, like Windows 10, on your Kali PC. In this instance, you can build a dual-boot structure. This will allow you to have both systems on your physical computer. However, switching between them will always require a computer restart.
You can utilize virtualization programs like VMware or VirtualBox on your host machine. This lets you run the preferred active system on a virtual machine without restarting your computer.
How to Create a New VM for Kali Linux
After installing Oracle VM VirtualBox on your Windows 10 computer, you can create a new virtual pc for Kali or other Linux distributions with simple steps.
Step 1
After running the VirtualBox program, click the New icon in the tool menu and open the virtual machine creation wizard. When you type the name of the Linux distribution you will install in the VM wizard, the values in the Type and Version sections are automatically selected.
However, Oracle software may not detect some systems correctly, so you need to adjust some settings yourself. Since the Kali Linux system is Debian-based, change the virtual computer version to Debian (64-bit) and click Next.
Step 2
Determine a suitable RAM size for your Kali virtual computer depending on the hardware performance of your host computer. If you have a memory size of 8 GB on your host computer, configure the virtual memory size of your VM as 4 GB and click Next.
Step 3
Since you will install Kali from scratch on the virtual computer you created, check to Create a Virtual Hard Disk Now in the HDD configuration and click the Create button.
Step 4
If you do not run to use your Kali guest machine in any software other than Oracle virtualization software, select the virtual hard disk file type as VDI (VirtualBox Disk Image) and click Next.
Step 5
If you configure the virtual disk of your Kali virtual computer to a Fixed Size, the space equal to the disk size will be allocated from your host disk. This setting improves VM performance but takes up more space on your host disk.
Therefore, select the Dynamically Allocated feature and click Next to configure the space allocation on your host disk as much as the guest operating system will need.
Step 6
If you plan to create a virtual disk backup with a VDI file extension, you can store it on one of your external storage devices. In that case, you can change the disk location in the File Location and Size window.
Suppose you prefer to have the virtual disk backed up to the destination where the VM will be installed. In that case, bypassing the alteration of the file location is recommended. Instead, adjust the disk size to accommodate your system’s requirements for the tasks you perform, and then proceed by clicking the Create button.
Step 7
After preparing your Kali VM, click Settings to add an ISO file or change the boot order.
Step 8
In the advanced tab of your virtual computer’s general settings, change the relevant settings to Bidirectional to enable the shared clipboard and drag-and-drop features between your host and VM.
- Shared Clipboard: Bidirectional
- Drag’n’Drop: Bidirectional
Step 9
Disable Floppy from Boot Order devices in your virtual machine’s System / Motherboard settings and configure the Optical device as primary.
Step 10
Configure the Processor hardware setting of the Kali VM according to the virtual core of your host CPU. The green area indicates that you can select a maximum of 4 cores. Still, you can set a higher value for higher performance.
Step 11
If you will use applications that require high graphics power in your guest operating system, enable the 3D Acceleration feature in the Display settings and configure the Video Memory size to the maximum value.
Step 12
View the Storage hardware settings and delete the old technology IDE Controller.
Step 13
Click the Leave Empty button to add an empty optical drive in the Optical Disk Selector window that opens after clicking the icon next to the SATA Controller.
Step 14
Enable the Host I/O Cache feature to increase the write and read speed of the SATA controller in your virtual computer.
Step 15
To increase the performance of the Kali Linux 2024.vdi virtual disk, configure the SATA Port setting as Solid-State Drive (SSD) in the Attributes tab.
Step 16
To add the Kali Linux ISO file to the virtual pc, select the Empty optical disk, then click the CD/DVD icon and click Choose a disk file from the drop-down options.
Step 17
Select the Kali Linux image file you downloaded to your computer from the link here and click Open.
Step 18
If you want to connect and use your USB 3.x devices in your Kali virtual system, change the Compatibility setting from the USB hardware settings to the USB 3.0 (xHCI) Controller and close the VM wizard.
Step 19
Click Start to run the Kali Linux virtual computer you prepared with Oracle and start the setup wizard.
How to Install Kali Linux in VirtualBox
Once you have successfully created a Linux VM using VirtualBox, running the VM allows you to set up your system like a physical PC effortlessly. Therefore, installing an operating system on a virtual system follows the same stages as setting it up on a PC.
Step 1
Press Enter in the Graphical Install option in the Kali Linux installation wizard.
Step 2
When you continue with the graphical installation, select the language in which you will perform the installation process on the Select a Language screen that opens. The language you choose here will also be your system display language.
Step 3
The Location setting, which is generally configured as your country of residence, sets the time zone for your system. Thus, you can display your system time accurately.
Step 4
Configure your virtual computer’s keyboard layout according to your host computer’s hardware.
Step 5
Type a hostname to identify your Kali virtual machine on your network and continue.
Step 6
If your network environment has an Active Directory server, type your domain name to add your VM to the domain network.
Step 7
Type your full username for the account that will be used instead of the root account on your Kali system.
Step 8
Please enter your account name, which will be utilized for logging into your system, using lowercase letters.
Step 9
Create a solid and hard-to-guess password to prevent anyone else from accessing your virtual system.
Step 10
If the checklist does not form your time zone, you can change your location by revisiting the setup wizard.
Step 11
In the Partition Disks window, you can see the virtual HDDs that you have added to the virtual machine. Choose the virtual disk where you wish to install the Linux system within this window.
Step 12
You can use different schemes to partition the virtual disk of your choice. If you are an entry-level user of Linux, we recommend continuing with the All Files In One Partition option.
Step 13
After configuring the disk, click Continue to finish the partition process and write the changes to the disk.
Step 14
After checking the changes to be made on the disk, select Yes to confirm writing the changes to the disk and click Continue.
Step 15
After partitioning, select the Kali desktop environment during system setup and continue.
Step 16
Select the Yes button to install the GRUB Boot Loader on the drive configured as the primary.
Step 17
Select your virtual disk for Boot Loader installation and click Continue.
Step 18
After installing Kali Linux, remove the installation media and click Continue to boot your system.
Step 19
Press Enter in the Kali GNU/Linux option on the Kali boot screen.
Step 20
Type the username and password you set during installation and click Log In.
How to Install Guest Additions in Kali Linux VM
After installing Kali Linux with VirtualBox, you must install Guest Additions to install the drivers for your guest operating system and use your host PC’s devices, such as USB and webcam.
Usually, the Guest Additions are installed automatically when your host PC is linked to the Internet while building a guest operating system on the virtual machine. However, if the automatic installation does not occur, you must manually perform this task.
Step 1
While your Kali Linux guest operating system is running, click Devices / Insert Guest Additions CD Image from the tool menu and mount the installation media to the system.
Step 2
To start installing, use CTRL + Alt + T to open the command console. Then, execute the following commands to list the contents of the CD image mounted on your system.
cd /media/cdrom
ls
sudo sh ./VBoxLinuxAdditions.run
Step 3
When you see the Kernel Header 5.18.0-kali5-amd64 error in the terminal while installing Guest Additions, you must install this package and its dependent packages on your system.
Step 4
To get VirtualBox working on Linux, type “sudo apt install build-essential dkms” into the terminal to install the correct kernels.
sudo apt install build-essential dkms
NOTE: If the packages required for Guest Additions cannot be installed automatically using the above command, download and install the relevant packages manually in the terminal.
wget http://http.kali.org/pool/main/l/linux/linux-headers-5.18.0-kali5-amd64_5.18.5-1kali6_amd64.deb | wget http://http.kali.org/pool/main/l/linux/linux-headers-5.18.0-kali5-common_5.18.5-1kali6_all.deb | wget http://http.kali.org/pool/main/l/linux/linux-kbuild-5.18_5.18.5-1kali6_amd64.deb | wget http://http.kali.org/pool/main/l/linux/linux-compiler-gcc-11-x86_5.18.5-1kali6_amd64.deb
sudo dpkg -i *.deb
Step 5
The installation process will be successful once you try to install Guest Additions again on your Kali VM.
Step 6
To check the Guest Additions version, execute the “sudo /usr/sbin/modinfo vboxguest” command in the terminal.
sudo /usr/sbin/modinfo vboxguest
Step 7
Restart your Kali virtual system, and when you try to transfer a file by dragging and dropping a file from your host PC to the desktop environment of your VM, you can see that the file is copyable.
Step 8
You can select whether to use your virtual computer in full-screen or windowed mode.
How to Configure Shared Folder
You can enable and use Oracle software’s Shared Folder feature to quickly copy larger files between your Kali VM and your host.
Step 1
Click Devices / Shared Folders / Shared Folders Settings in the tool menu of your Kali VM.
Step 2
In the Shared Folders configuration window, click the add icon as in the image below, and then click Other from the drop-down list in the Add Share window that opens.
Step 3
Create a shared folder in a location of your host operating system and change its name as you wish.
Step 4
After specifying the folder on your host, if you want this folder on your VM to be automatically mounted and permanent every time you restart your system, tick the Auto-Mount and Make Permanent options and click OK.
Step 5
Create a new folder in KaliSharedFolder on your host computer’s desktop and check the folder’s contents from Home or media/sf_KaliSharedFolder from your virtual system.
NOTE: If you get a user permission denied error when you try to access sf_KaliSharedFolder, you must make your user account a member of the vboxsf group. To add your user account to the vboxsf group, execute the “sudo adduser $USER vboxsf” command in the terminal and reboot your system.
sudo adduser $USER vboxsf
Step 6
You can construct a shortcut on the desktop location to access the shared folder faster.
sudo ln -s /media/sh_KaliSharedFolder ~/Desktop
How to Use USB Flash Memory
Connecting your USB storage devices or flash drives to your Kali guest system lets you do your work, quickly back up your files, or install any software.
Step 1
First, plug your flash disk into one of your physical computer’s free USB 3.x ports and then create a folder named ‘Backup’ to test your disk in the VM.
Step 2
Click Devices / USB / Name of Your USB in the tool menu of your Kali VM to connect your USB to the virtual machine.
Step 3
When you check the contents of your USB memory that is automatically mounted to your Linux system, you can access the folder named Backup.
How to Delete the Virtual Machine from Kali Linux
Once you have removed all files of the guest system from your PC, it is vital to verify that there is no remaining anything associated with it. You can do this by scanning both the virtual machine library of the Oracle software and the installation location on your host PC.
Step 1
Right-click / Remove the virtual machines listed on the left panel of your Oracle software and click the Delete All Files button in the open window.
Step 2
After deleting all the files of the guest system from your PC, you can check that there are no files or folders related to the guest operating system both in the virtual machine library of the Oracle software and in the installation location of your host PC.
Video
Installing Old Versions
Kali / VBox Version | YouTube Video | Slide |
---|---|---|
2022.1 / 6.1.32 | Watch | View |
2022.3 / 6.1.36 | Watch | – |
Conclusion
As a result, you can install Kali Linux 2024 distribution in a virtual machine with Oracle VM VirtualBox on your Windows 10 & 11 PC. So you can dive into the world of cybersecurity and discover the many features and capabilities of Kali Linux.
In short, you can run Kali as a VM thanks to the steps I have explained professionally in this article. Afterward, you can experience this excellent system in terms of testing, learning, and network security.
Moreover, Kali is a good choice for personal use, cybersecurity training, or professional purposes. So you can improve your skills by using it in a controlled and safe environment.