Creating VM using VirtualBox

Myglobin
4 min readJun 11, 2021

--

First let’s talk about what a VM, Virtual Machine is. A virtual machine (VM) is a virtual environment that works like a computer within a computer. It runs on an isolated partition of its host computer with its own resources of CPU power, memory, an operating system (e.g. Windows, Linux, macOS), and other resources. VMs are made possible through virtualization technology. Virtualization uses software to simulate virtual hardware that allows multiple VMs to run on a single machine. The physical machine is known as the host while the VMs running on it are called guests.

This process is managed by software known as a hypervisor. The hypervisor is responsible for managing and provisioning resources — like memory and storage — from the host to guests. It also schedules operations in VMs so they don’t overrun each other when using resources. VMs only work if there is a hypervisor to virtualize and distribute host resources.

There are two types of hypervisors used in virtualization.

Type 1 hypervisors

Type 1 hypervisors (also known as bare metal hypervisors) are installed natively on the underlying physical hardware. VMs interact directly with hosts to allocate hardware resources without any extra software layers in between.

Host machines running type 1 hypervisors are used only for virtualization. They are often found in server-based environments like enterprise data centers. Some examples of type 1 hypervisors include Citrix Hypervisor (previously XenServer), VMware vSphere, and Microsoft Hyper-V.

A separate management tool is needed to handle guest activities like creating new virtual machine instances or managing permissions.

Type 2 hypervisors

Type 2 hypervisors (also called hosted hypervisors) run on the host computer’s operating system.

Hosted hypervisors pass VM requests to the host operating system, which then provisions the appropriate physical resources to each guest. Type 2 hypervisors are slower than their type 1 counterparts as every VM action has to go through the host operating system first.

Unlike bare-metal hypervisors, guest operating systems are not tied to physical hardware. Users can run VMs and use their computer systems as usual. This makes type 2 hypervisors suitable for personal users or small businesses that don’t have dedicated servers for virtualization.

VirtualBox

Now, what is VirtualBox. VirtualBox is a powerful virtualization product for enterprise as well as home use delivered by Oracle. Download the VirtualBox from the official site: https://www.virtualbox.org/ .

After installing VirtualBox, open the VirtualBox Manager. Below app opens up.

Oracle VM VirtualBox Manager

Click the New button to create a new VM. Give name and select the OS type and version in the pop up box.

In the next window, select the memory size you need and then select Create a virtual hard disk now option in the next window. Select VDI as hard disk file type and Dynamically allocated as storage on physical hard disk. Choose a file location and size and click Create.

Now, let’s configure and install OS in the VM. Here, I have selected the Linux OS, Centos 8. Download the CentOS image file.

Before starting the VM, let’s configure the VM. Go to Settings. In General, in Advanced, select Bidirectional for shared clipboard and drag’n’drop options.

In System tab, move option Optical to top in Boot Order since we are using OS image file (.iso file).

Now, in Storage tab, select Empty and Live CD/DVD in the attributes section.

Start the VM by clicking Start button. A new window pops up.

Browse the OS image (.iso) file and click Start.

Setting the OS in a VM is explained in my another blog: Setting up OS in VM.

--

--