Installing VirtualBox

VirtualBox is open-source software for virtualizing the x86 computing architecture. It acts as a hypervisor, creating a VM (virtual machine) in which the user can run another OS (operating system). The operating system in which VirtualBox runs is called the "host" OS. The operating system running in the VM is called the "guest" OS. VirtualBox supports Windows, Linux, or macOS as its host OS.

When configuring a virtual machine, the user can specify how many CPU cores, and how much RAM and disk space should be devoted to the VM. When the VM is running, it can be "paused." System execution is frozen at that moment in time, and the user can resume using it later.

To start with, we will download VirtualBox and install it. We should follow the steps given below for the installation.

Step 1 To download VirtualBox, click on the following link https://www.virtualbox.org/wiki/Downloads Now, depending on your OS, select which version to install. In our case, it will be the first one (Windows host).

VM

Step 2 Once the option is selected, click on “Next”.

VM

Step 3 You have the option asking where to install the application. We can leave it as default and click on “Next”.

VM

Step 4Once the options are selected as shown in the following screenshot, click on Next.

VM

Step 5 A dialog box will come up asking whether to proceed with the installation. Click “Yes”.

VM

Step 6 In the next step, click on “Install”.

VM

Step 7Tick the start VirtualBox check box and click on “Finish”.

VM

Step 8 VirtualBox application will now open as shown in the following screenshot. Now, we are ready to install the virtual machines.

VM

Creating a VM with VirtualBox

To create a virtual machine with Oracle VirtualBox, we should follow the steps given below.

Step 1 Click on the “Oracle VM VirtualBox” icon on the desktop as shown in the screenshot below.

VM

Step 2 The next step is to click on “New” button, which is in the top left hand side of the screen.

VM

Step 3A table will pop-up requesting you the parameters for the virtual machine. These will be −
Name − We have to put a friendly name for this Virtual Machine.
Type − Enter the OS that is going to be installed on it.
Version − Enter the specific version for that OS, which we have selected earlier.

Once all the above parameters are filled, click on “Next”.

VM

Step 4 Select the amount of memory that you need to allocate in this VM → Click on “Next”.

VM

Step 5 Check one of the three options for the HDD and click on “Create”.

VM

Step 6 Select a file extension for your virtual HDD (It is recommended to use a common file extension that most of the hypervisors use like VHD) → click on “Next”.

VM

Step 7Choose whether you want the Virtual HDD as dynamic or fixed. This is based on your needs → Click on “Next”.

VM

Step 8 Put a name for your virtual HDD file and select the disk size for your VM → Click on “Create”.

VM

All the above steps can be done in one shot by selecting the “Expert mode”.

VM

Setting up Networking with VirtualBox

There are two types of networking modes in VirtualBox, which are −

1. Nat Networks and
2. Host-only Networks.

Both of these are explained in detail below.

Nat Networks

For setting up Nat Networks, we should follow the steps given below.
Step 1 Go to Oracle VM VirtualBox Manager → Click on “Preferences…”

VM

Step 2 Click on “Network” and then on the left panel click on the “NAT Networks” tab.

VM

Step 3 Click on the “+” button, which is highlighted in the screenshot below.

VM

Step 4 Here, we have to put the “Network Name” and the IP range for this network that will be NAT-ed, in order to have access to internet and to other networks.

VM

Host-only Networks

For setting up Host-only Networks, we should follow the steps given below.
Step 1 If you click on the “Host-only Networks” tab, you can create networks that are isolated from the other networks. However, VM hosts communicate with each other and the Hypervisor machine. Click on the “+” sign.

VM

Step 2The host interface will continue to be created as shown in the screenshot below.

VM

Step 3If you click on VirtualBox Host button, you can edit the settings.

VM

Step 4 Here, we have to put the “Network Name” and the IP range for this network that will be NAT-ed, in order to have access to internet and to other networks. If you want your host machines to take “DHCP IP”, click on the “DHCP Server” tab and check the box “Enable Server” → Click “OK”.

VM

Step 5 In the “Adapter” tab, put the IP of the hypervisor.

VM

After all these preparations for setting up the network modes is complete. It is now time to assign a network to our VMs. To do this, Click on the VMs on the left side of the panel, then right click on the “Network” option and a table will be open.

VM