Getting comfortable with VirtualBox
In Chapter 1, Up and Running with Kali Linux, we briefly explored the use of VirtualBox for installing Kali Linux in a virtual environment. VirtualBox is the current product of Oracle, and runs as an application on a host operating system. It allows for guest operating systems to be installed and run by creating virtual environments. This tool is vital to providing targets for you to test your skills with Kali Linux.
Throughout this chapter, we will depend heavily on VirtualBox and changing its configuration to get the type of network configuration we desire. We will use this section at the start of each of our scenario sections, so becoming comfortable with the steps is the key.
Getting ready
A connection to the Internet or an internal network is required to complete this module.
How to do it...
Let's begin the process by opening VirtualBox:
- Launch VirtualBox and click on New to start the Virtual Machine Wizard:
- Click on the Next button and type the name of the virtual machine and choose the OS Type: as well as the Version:. In this chapter, we will use either Linux, Solaris, or Windows operating system. Select your appropriate operating system. Click on the Next button to continue:
- Select the amount of base memory (RAM) to be allocated to the virtual machine. We're going to use the default value. Click on Next.
- Create a new virtual hard disk for the new virtual machine. Click on the Next button:
- A new wizard window will open. Leave the default VDI file type as we're not planning to use other virtualization software.
- We'll leave the default option as the virtual disk storage details. Click on Next to continue.
- Set the virtual disk file location and size:
- Check whether the settings are correct and click on the Create button to start the virtual disk file creation.
- We're back to the previous wizard with a summary of the virtual machine parameters. Click on Create to finish:
- With the new virtual machine created, we're ready to install the operating system that was just configured in VirtualBox.
- On the VirtualBox main window, highlight the operating system name we just created and then click on the Settings button:
- Now that the basic installation steps have been followed, we will proceed to allow you to use your downloaded ISO file as a virtual disc. This will save you from having to burn a physical DVD to complete the installation. On the Settings screen, click on the Storage menu option:
- Next, under Storage Tree, highlight the Empty disc icon underneath Controller: IDE. This selects our "virtual" CD/DVD ROM drive. To the far right-hand side of the screen, under Attributes, click on the disc icon. In the pop up that follows, select your ISO file from the list. If the ISO file is not present, select the Choose a virtual CD/DVD disc file... option and locate your ISO. Once you have completed these steps, click on the OK button:
- Click on the Start button and then click inside the new window and proceed with the installation. The installation steps are covered in the Installing to a hard disk drive recipe of this chapter.
How it works...
The chapter began by creating a new virtual instance in VirtualBox. We then proceeded to select our operating system and set both the memory and hard drive size. Later, we selected our ISO file and then inserted the ISO into our virtual CD/DVD drive. Finally, we started the virtual environment so that our operating system could be installed.
Throughout the rest of this chapter, we will be using VirtualBox as our tool of choice to set up our various environments.
There's more...
We will be performing tasks on our hosts that may cause them to become unstable or even fail to run. VirtualBox provides us with an excellent tool for making a copy of our virtual environment:
- From the main screen, left-click on the virtual server you would like to clone.
- Right-click on the virtual server you would like to clone and press the Clone... menu option:
- On the clone screen, give your new virtual server a name.
- Click on Next, and on the following screen, choose between creating a Linked clone or a Full clone, as shown in the following screenshot:
- Full Clone: In a full clone, an exact independent replica of the virtual machine is created.
- Linked Clone: In a linked clone, a snapshot is taken and the clone is created. However, the linked clone is dependent on the original file in order to function. This can degrade the performance of the linked clone.
- Click on Clone and wait for the virtual machine to clone: