VirtualBox software allows us to create and run virtual machines on a single hardware machine. The install of VirtualBox on Centos involves a series of steps that include install of kernel modules and extension packs.
As a part of our Server Management Services, we help our Customers with software installations regularly.
Let us today discuss the steps to install VirtualBox on Centos.
How to install VirtualBox On CentOS 7?
Enabling Hardware Virtualization
The initial step in enabling virtualization is to enable AMD-v or VT-x/VT-d from the BIOS of the computer. Otherwise, the virtual machines will not perform as expected. Once this is done, we shall proceed with installing VirtualBox.
Installing VirtualBox 6.0 From Oracle Repositories on CentOS
The first step in installing VirtualBox is to prepare the system by updating the current CentOS 7 installation. This can be done using the command:
$ sudo yum update
Now the system is ready for the installation. The installation process involves the steps below:
- Install vboxdrv Kernel Module
- Download VirtualBox Repository
- Install VirtualBox 6.0
- Install Oracle VirtualBox Extension Pack
- Start VirtualBox
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 the system to start using the new kernel:
$ sudo reboot
Download VirtualBox Repository
Now, to download the VirtualBox Oracle repository enter:
$ sudo wget http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo -P /etc/yum.repos.d
Thus this command downloads the repository file and places it in the /etc/yum.repos.d directory.
Install VirtualBox 6.0
Now, we can install VirtualBox 6.0 from the downloaded repository:
$ sudo yum install VirtualBox-6.0
The system prompts us to accept the GPG key. Enter y to confirm.
After the installation completes, 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.
Install Oracle VirtualBox Extension Pack (Optional)
Now, additional packs for functions like the use of USBs, remote desktop protocols, or disk encryption need to be installed separately.
First, 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
Now, the terminal confirms that the packs have been downloaded.
Next, import the pack to VirtualBox:
$ sudo VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-6.0.4.vbox-extpack
Now, confirm that we agree to the terms and conditions with y. Finally, the system confirms the successful installation of the extension pack.
Start VirtualBox
Now, to access the newly installed VirtualBox, use the command:
$ VirtualBox
Then, the VirtualBox manager interface will open as shown below.
However, we can use the graphical interface and access the application from Application >> System Tools >> Oracle VM VirtualBox.
[Need any further assistance to install Virtualbox on Centos? – We’re available 24*7]
Conclusion
In short, VirtualBox is cross-platform virtualization software that allows us to create and run virtual machines on a single hardware machine. Today, we saw how our Support Engineers install VirtualBox on Centos.
Thanks! Worked great.