How to Install VirtualBox on CentOS 7

Introduction

Oracle VirtualBox is a virtualization software solution that allows you to create and run virtual machines on a single hardware machine. By using a Type 2 hypervisor, like VirtualBox, your existing operating system stays unaffected by the virtual environment.

This guide outlines how to install VirtualBox on CentOS 7.

tutorial on installing VirtualBox on CentOS 7

Prerequisites

  • Access to a terminal window (Crtl+Alt+T)
  • A user with sudo privileges
  • CentOS with GUI

Installing VirtualBox 6.0 From Oracle Repositories on CentOS

Prepare your system by updating the current CentOS 7 installation using the command:

sudo yum update

Step 1: Install vboxdrv Kernel Module

VirtualBox uses the vboxdrv kernel module to control and allocate physical memory for the guest operating systems.

To install additional modules (kernel-devel, dkms, kernel-headers, wget, and other dependency packages) enter:

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

Once the installation is complete, reboot your system to start using the new kernel:

sudo reboot

Step 2: Download VirtualBox Repository

To download the VirtualBox Oracle repository enter:

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

The command downloads the repository file and places it in the /etc/yum.repos.d directory.

Confirmation of downloading and saving the virtualbox repository file

Step 3: Install VirtualBox 6.0

Install VirtualBox 6.0 from the downloaded repository:

sudo yum install VirtualBox-6.0

The system prompts you to accept the GPG key. Enter y to confirm.

After the installation has finished, check the status of the VirtualBox Linux kernel module service:

sudo systemctl status vboxdrv

The output confirms that the service is active, and provides a timestamp.

Image shows that VirtualBox Linux kernel module is active with date and time

Step 4: Install Oracle VirtualBox Extension Pack (Optional)

Additional packs for functions like the use of USBs, remote desktop protocols, or disk encryption need to be installed separately.

To download the extension VirtualBox pack, enter:

wget http://download.virtualbox.org/virtualbox/6.0.4/Oracle_VM_VirtualBox_Extension_Pack-6.0.4.vbox-extpack

The terminal confirms that the packs have been downloaded.

extension pack is saved to the correct file

Next, import the pack to VirtualBox:

sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.0.4.vbox-extpack

Confirm that you agree to the terms and conditions with y. The system confirms the successful installation of the extension pack.

Confirmation that the extension pack is installed sucessfully

Step 5: Start VirtualBox

To access the newly installed VirtualBox, use the command:

VirtualBox

The VirtualBox manager interface will prompt you:

oracle VM VirtualBOX Manager welcome page

Alternatively, you can use the graphical interface and access the application:

Application >> System Tools >> Oracle VM VirtualBox

Conclusion

By following these instructions, you have learned how to install VirtualBox on your CentOS 7 system.

VirtualBox provides a simple, cost-effective method for setting up multiple virtual environments. Always consider the physical limitations of memory and processing power of your host machine.

Learn more about VirtualBox and its features by referring to our article Virtualbox Vs VMware.

Was this article helpful?
YesNo
Vladimir Kaplarevic
Vladimir is a resident Tech Writer at phoenixNAP. He has more than 7 years of experience in implementing e-commerce and online payment solutions with various global IT services providers. His articles aim to instill a passion for innovative technologies in others by providing practical advice and using an engaging writing style.
Next you should read
Raid Levels and Types: Advantages and Disadvantages of 0,1,5,10
July 23, 2019

RAID (redundant array of independent disks) is a setup consisting of multiple disks for data storage. They...
Read more
How to Install Kali Linux on VirtualBox
March 28, 2024

Kali Linux is a Debian-derived Linux distribution designed for penetration testing. With over 600...
Read more
How to Install VirtualBox on Ubuntu
March 13, 2024

VirtualBox is a powerful tool for running a virtual operating system on your computer. In this tutorial learn...
Read more
What is Server Virtualization? Definition and How it Works
February 24, 2019

A virtualized server allows one piece of hardware to be used as multiple virtual servers. Learn about Server...
Read more