Auto-translation used

Introduction to Virtualization

Any system is a reflection of its component parts — this is the key concept underlying virtualization. In this article, we will look at the virtualization of guest operating systems, or, more simply, the concept of a "computer inside a computer." The main computer on which all this happens is called the host. A special hypervisor software is installed on the host, which ensures the operation of the guest operating system. Thus, the key elements here are three concepts: host, hypervisor, and guest system.

  • A host is a physical computer that provides its resources (processor, memory, disk space) for the operation of a virtual environment.
  • A hypervisor is a program or management layer that creates and maintains virtual machines, distributing host resources between them.
  • The guest system is a virtual operating system running inside the host thanks to the hypervisor.

There are basically two types of hypervisors: 1st and 2nd level:

Virtualization of the first type (Bare-metal) In this case, the hypervisor is installed directly on the hardware, bypassing any intermediate operating system. Examples of hypervisors of the first type: VMware ESXi, Microsoft Hyper-V (in bare-metal mode), Xen.

Virtualization of the second type (Hosted) Here, the hypervisor is installed on top of an existing operating system, which, in turn, runs on hardware. In this case, the operating system itself is considered the host, and the hypervisor functions as an application inside it. Examples of hypervisors of the second type: VirtualBox, VMware Workstation, Parallels Desktop.

To begin with, we'll look at the VirtualBox hypervisor, an example of the second type of virtualization (hosted). This type of hypervisor runs on top of an existing operating system, making it easier to install and use, especially for beginners. VirtualBox is ideal for exploring virtualization, as it does not require complex configuration and is compatible with most modern operating systems.

As for the choice of the guest operating system, we will focus on Linux distributions. In particular, we will talk about systems based on two popular families: RHEL (Red Hat Enterprise Linux) and Debian. The first includes distributions such as CentOS, Rocky Linux or Fedora, and the second includes Ubuntu, Linux Mint and Debian itself. These options are widespread, well documented, and suitable for both learning and practical use.

To get started with virtualization, we need to install the VirtualBox hypervisor. Go to the official VirtualBox website at www.virtualbox.org and find the "Downloads" section. On this page, select the version of the program that is suitable for your operating system. In my case, this is Fedora — for Linux distributions, the site usually suggests downloading a package for a specific family. Since Fedora is based on RHEL, make sure that you choose a version compatible with RPM packages (for example, for Fedora or Red Hat).

After downloading the RPM file, open a terminal and install it using the command:

sudo dnf install ./VirtualBox-<version>.rpm

Replace <version> with the current name of the downloaded file. The dnf team is a Fedora package manager that will install VirtualBox and all the necessary dependencies. After the installation is complete, you can launch VirtualBox from the application menu or through the terminal with the virtualbox command.

Now that VirtualBox is installed, it's time to launch the guest operating system. To do this, we will need an operating system image in ISO format. To better understand the virtualization process, it is recommended to choose a guest OS other than the host OS. In my case, the host system is Fedora, and I use Ubuntu Server as a guest. You can download the Ubuntu Server ISO image from the official website. ubuntu.com .

If your host OS is Fedora, it is important to keep in mind that it may initially lack some of the hypervisor drivers required for VirtualBox to work. In order for everything to function correctly, you need to install them manually. Follow these steps:

Open a terminal and install the necessary packages, including virtualization support.:

sudo dnf install @development-tools kernel-devel kernel-headers dkms
sudo dnf install VirtualBox

The dkms package will help you to update kernel modules for VirtualBox automatically.

After installation, update the VirtualBox configuration on behalf of the superuser:

sudo /sbin/vboxconfig

This command will configure the drivers and kernel modules.

Fedora uses the KVM (Kernel-based Virtual Machine) kernel module by default, which may conflict with VirtualBox. To avoid problems, temporarily disable it.:

sudo modprobe -r kvm_intel # For Intel processors
sudo modprobe -r kvm_amd# For AMD processors

Make sure that you are using the correct command, depending on your processor (Intel or AMD). To permanently disable these modules, you can add them to the blacklist by editing the /etc/modprobe.d/blacklist.conf file.

 1) Open the hypervisor, after new
2) Name, ISO image (Download on the manufacturer's website)
Here's next (remember the login details)
We allocate RAM and cores
We allocate memory on the host's hard disk for the virtual disk of the guest OS
Finish
Done.

We installed the VirtualBox hypervisor on the Fedora host system, configured it by disabling the conflicting KVM module, and launched the Ubuntu Server guest system using an ISO image. Now we have a working virtual machine for further experiments.

Comments 0

Login to leave a comment