Virtualization is a technology that lets you create multiple operating systems (virtual) to run on one host at the same time by use of a virtualization platform like VirtualBox. Virtualization came to solve the issue of having to create different software for different systems due to the host’s base system resources not integrating with the software. Software called Hypervisors separates the physical resources from the virtual environments that need to use these resources. There are 2 main types of Virtualization:

  • Type 1 Hypervisor or commonly referred to as a bare metal hypervisor is a type that runs the virtual machines directly on the host hardware system. They include AntsleOs, Xen, XCP-ng, Microsoft Hyper V, VMware ESX/ESXi, and Oracle VM Server for x86.
  • Type 2 Hypervisor also known as Host OS Hypervisor, runs a virtual machine on a program that is installed on the host system. They include VMware Workstation, VMware Player, and VirtualBox.

What is VirtualBox?

Virtualbox is a cross-platform virtualization application that extends the capabilities of your existing computer so that it can run multiple Operating Systems, inside multiple virtual machines, at the same time. It is a small, simple yet powerful application that can run on small embedded systems, datacenter deployments, and cloud environments. The Operating System on the physical hardware is called the Host OS. The operating system running inside a VirtualBox or any other virtual machine is called the Guest OS. VirtualBox is supported in Windows, macOS X, Linux, or Oracle Solaris operating systems.

Features of VirtualBox

  • Guest Additions: These are software packages that can be installed on the Guest OS to improve its performance and functionality. They include Shared Folders, seamless windows, and 3D virtualization.
  • Supports Multi screens resolutions taht can be spread over a large number of screens attached to the host system.
  • Built-in iSCSI support enables you to connect a virtual machine directly to an iSCSI storage server without going through the host system.
  • VirtualBox can save arbitrary snapshots of the state of the virtual machine that allows you to revert to a previous state and continue from there.
  • VirtualBox provides a group feature that enables a user to organize and control virtual machines collectively.
  • Modular design with well-designed internal programming interfaces and clean architecture with separation of client and server code
  • It contains a VirtualBox Remote Desktop Extension (VRDE) that supports the Microsofts Remote Desktop Protocol for remote machine display.
  • Portability allows it to run on a large number of 64-bit operating systems.
  • Supports Extension packs that easily extend the functionality of the VirtualBox base package.

This guide shows you how to Install and use VirtualBox on CentOS 9|AlmaLinux 9|RHEL 9.

Install and Use VirtualBox 6.1 on CentOS Stream 9 / RHEL 9

Update your system packages

sudo yum update -y

Install Dependency packages for VirtualBox.

sudo yum -y install kernel-devel kernel-headers make patch gcc wget

Once the installation is done, reboot your system.

sudo reboot

After reboot, download the VirtualBox repository:

sudo wget http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo -P /etc/yum.repos.d

Install the latest VirtualBox release:

sudo yum install VirtualBox-6.1 -y

To verify your VirtualBox installation check its status.

$ systemctl status vboxdrv
● vboxdrv.service - VirtualBox Linux kernel module
     Loaded: loaded (/usr/lib/virtualbox/vboxdrv.sh; enabled; vendor preset: di>
     Active: active (exited) since Thu 2022-07-28 16:02:12 EAT; 27s ago
    Process: 6412 ExecStart=/usr/lib/virtualbox/vboxdrv.sh start (code=exited, >
        CPU: 184ms

Install VirtualBox Extension Pack

Oracle provides additional extension packs that can be downloaded which extend the functionality of the Oracle VM VirtualBox base package. To download them Go to the Index of VirtualBox and select the Version of VirtualBox installed and click on it to find the package. Alternatively, you can use the following command to download.

VER=$(curl -s https://download.virtualbox.org/virtualbox/LATEST.TXT)
wget https://download.virtualbox.org/virtualbox/$VER/Oracle_VM_VirtualBox_Extension_Pack-$VER.vbox-extpack

Then once downloaded, import it to VirtualBox.

$ sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-$VER.vbox-extpack
....
Do you agree to these license terms and conditions (y/n)? y

License accepted. For batch installation add
--accept-license=33d7284dc4a0ece381196fda3cfe2ed0e1e8e7ed7f27b9a9ebc4ee22e24bd23c
to the VBoxManage command line.

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Successfully installed "Oracle VM VirtualBox Extension Pack".

Using VirtualBox on CentOS 9 / RHEL 9

To Launch VirtualBox, You can go to Activities and search it from the installed application.

Or use the following command and launch it from the terminal.

VirtualBox

Create a Virtual Machine in VirtualBox in CentOS 9|RHEL 9

We are going to install Ubuntu Distribution on the Virtual Machine. You can download the ISO image from the Ubuntu Downloads Page. To create a virtual machine, Click on New from the open window which opens another window as shown below.

Enter the Name of the Virtual Machine you want to create.

Next is to select the memory size to be allocated to the virtual machine.

Add a virtual hard disk to the virtual machine.

Choose the hard disk file type:

Choose how to allocate the hard disk file.

Input the name of the hard disk and select the size to allocate to the hard disk. Click Create.

The VM is created as shown below. Next is to add the image of the Operating system we need to install.

Click on Settings to add the ISO image. Under the Storage tab, on the Empty Directive click on the disk icon to select the ISO image.

Locate the ISO image on your system. I kept the image in the Downloads folder.

Once added, Click OK to save changes. Click on Start to start the Virtual Machine on VirtualBox.

The installation starts as shown below.

Follow the prompts to install the Operating system.

The installation process is as shown below. Then restart your system.

After restarting the Ubuntu desktop is as shown below. Your installation is successful once you see this.

Enable Shared Clipboard and Drag’n’Drop Feature

You can enable Shared Clipboard and Drag and Drop Features on Virtualbox. This allows the host and guest to copy contents and drag files between them. Go to Settings >> General >> Advanced then select the Bidirectional option.

Enable Shared Folders on VirtualBox

You can also enable shared folders between the Guest and Host. Go to Settings >> Shared Folders and click on the Add icon. Select the folder you wish to share and you can also restrict it to read-only. Click OK to save.

Then The folder is listed as shown below. You can edit or delete the folder.

Enable Bridged Networking

Bridged networking allows a device driver on your host system to filter data from your physical network adapter. This enables Oracle VM VirtualBox to intercept data from the physical network and inject data into it thus creating a new network interface in software. The guest OS looks into the interface as if it were physically connected to the interface using a network cable.

To Enable Bridged Networking, Go to Settings>>>Network and select Bridged Adapter in the drop-down list of the Attached to field.

Next see how to install VirtualBox Guest Additions:

Uninstall VirtualBox from CentOS 9|AlmaLinux 9|RHEL 9

To uninstall VirtualBox, Remove the repository and then remove the package itself.

cd /etc/yum.repos.d/
sudo rm -rf virtualbox.repo
sudo yum remove VirtualBox-*

Conclusion

VirtualBox general-purpose full virtualization application that enables users to run multiple systems at the same time on a single physical hardware. This guide has shown you how to Install and use VirtualBox on CentOS 9|AlmaLinux 9|RHEL 9. It is an Open-Source software that can be used at home for personal use and for Enterprise as well. It has a large development community that ensures frequent releases and additional features.

More guides to check out:

LEAVE A REPLY

Please enter your comment!
Please enter your name here