What is a Virtual Machine and why do we use it?
A virtual machine (VM) is a type of software that emulates a computer system by creating virtualized hardware components within a physical host computer. This allows you to run various operating systems (OS) such as Windows, macOS, Linux, and more on your PC. For example, suppose you have a Windows-based computer. On this computer, you can install a hypervisor which is software that generates VMs. After this, you can download a Linux ISO image to create a Linux VM within the installed hypervisor. By following these steps, you can use two different operating systems (Linux and Windows) simultaneously without needing extra computer hardware. Isn't that neat?
Virtual machines offer a wide range of possibilities, such as running software applications that are intended for older operating systems (legacy software), developing software in different environments, and testing potentially harmful programs in an isolated VM to protect your host computer from malware infections. As you can tell, VMs are highly beneficial for enhancing security, facilitating testing, and experimentation, but how can a VM benefit you?
If you're a beginner in the Cybersecurity field, it is absolutely crucial to create an environment to practice your skills (AKA a home lab). Utilizing VMs is an efficient and cost-effective way to create a home lab since you'll have all the tools available right on your PC and save money that would otherwise be spent on costly hardware. Now that you understand VMs, this tutorial will show you exactly how to install a free hypervisor and guide you through the process of installing your first VM!
Step 1: Make sure Hardware Virtualization is Enabled
1a. Before installing any VM hosting software, it's essential to review the end-user documentation to avoid errors and VM crashing. Here's the end-user documentation for Virtualbox, which outlines the minimum requirements that your machine must meet for virtualization on the hypervisor we will install today. Pay close attention to your operating system, processor, memory, and hard disk space, which must meet the requirements to continue with this tutorial.
1b. Hardware virtualization is an essential feature for using a VM. Your virtual machine will not work if this feature is disabled. To check if hardware virtualization is enabled, type "cmd" in your Windows search bar and press enter to open the command terminal.
1c. In the command terminal type systeminfo.exe and press enter. A list of information should appear (the information in the image below has been censored).
1d. Scroll down to the section "Hyper-V Requirements". Look for a line called "Virtualization Enabled in Firmware". If enabled, you should see "Yes" written next to it like in the image below. In this case, you can move on to Step 2.
1e. If you see "No", hardware virtualization is disabled. Refer to this video to turn on hardware virtualization for Windows 11. ➡️
Step 2: Download Virtualbox Hypervisor
2a. Visit Virtualbox.org and click "Download Virtualbox". This is an open-source hypervisor that will allow you to host multiple VMs.
2b. Click "windows hosts" to download Virtualbox and run the setup wizard.
2c. In the Virtualbox setup wizard, continue to press "Next >" until it prompts you to install Virtualbox. A warning will pop up that your network will be temporarily disabled. This is fine, ignore it and continue to press "Next >".
2d. After the installation is complete, press "Finish" to start Virtualbox.
Step 3: Download Kali Linux ISO
3a. Visit Kali.org and click download. Here we will download a Kali Linux prebuilt virtual machine, which requires no extra configuration or customization.
3b. Next, click "Virtual Machines" and it will take you to three VM options.
3c. Click the Virtualbox64 logo. This will automatically install a zip file of Kali Linux. Take note of where the file is downloaded. This will install the newest version, Kali Linux Purple which offers tools for both offensive and defensive security.
3d. Locate the downloaded file in File Explorer. Unzip the file into a folder and make note of where the unzipped file is located. If you can't unzip your file, you can download the tool WinRAR to easily unzip the file as I did in the image below.
Step 4: Create a Kali Linux VM in Virtualbox
4a. Once you've unzipped the folder, open the folder until you see two files: a 13,000,000KB file and a 3KB file.
4b. Double-click the 3KB file and your virtual machine will appear in Virtualbox.
4c. In Virtualbox, double-click Kali Linux to start your VM. Login with the default credentials. (Username: kali Password: kali)
Step 5: Setup Virtualbox Guest Additions
5a. This step will allow you to open your VM in fullscreen and have a smoother experience, but this step is not necessary for your VM to function. On the top of the VM screen, click Devices > Insert Guest Additions CD Image.
5b. A CD icon should appear on the Kali Linux homepage. Double-click to open it to view it in the directory.
5c. In the directory, right-click the CD icon on the left and press "Open Terminal Here"
5d. In the terminal type:
sudo su
Press enter. It will ask you to type your password which is "kali", then press enter.
Next, type this code:
chmod 777 VBoxLinuxAdditions.run Press enter. (This code will change the permissions of the file making it readable, writable, and executable).
Next type this code:
sh VBoxLinuxAdditions.run
Press enter. It will then ask if you want to continue.
Type yes then press enter.
5e. Finally, restart the VM by closing out the VM window, and running it again in Virtualbox. Once the VM is restarted, click "View" on the top of the VM screen and "Auto-resize Guest Display". Now your VM is fully set up and ready to go!
Congratulations on successfully installing your first VM! Feel free to explore additional Project Tutorials on our blog and discover more ways to use VMs (coming soon). Don't forget to read about the VM we installed today, Kali Linux Purple, which offers a range of new offensive and defensive security tools in its latest version.
I hope that this tutorial and these tools will help you practice the skills needed for a successful cybersecurity career!
- Elyssa
Comments