In order to install VirtualBox virtualization software on CentOS Linux first install prerequisites:
yum install kernel-devel gcc
Next, download relevant RPM package to your CentOS version from https://www.virtualbox.org/wiki/Linux_Downloads
.
Once downloaded, navigate to directory where you have downloaded the VirtualBox RPM and execute check its signature eg.:
# rpm --import https://www.virtualbox.org/download/oracle_vbox.asc # rpm --checksig VirtualBox-5.0-5.0.0_101573_el7-1.x86_64.rpm
If signature match use below command to install VirtualBox package while replacing package version number with the one you have downloaded previously:
yum localinstall VirtualBox-5.0-5.0.0_101573_el7-1.x86_64.rpm
If from some reason the Virtualbox module compilation fails then check /var/log/vbox-install.log
to rectify the cause and attempt to recompile:
# /etc/init.d/vboxdrv setup Stopping VirtualBox kernel modules [ OK ] Removing old VirtualBox pci kernel module [ OK ] Removing old VirtualBox netadp kernel module [ OK ] Removing old VirtualBox netflt kernel module [ OK ] Removing old VirtualBox kernel module [ OK ] Recompiling VirtualBox kernel modules [ OK ] Starting VirtualBox kernel modules [ OK ]
Now you can start VirtualBox from main Menu or from command line:
$ virtualbox
Troubleshooting
In case you are getting an error messages about conflicting version already installed, you need to first uninstall your current virtualbox software. Example:
# rpm -qa | grep -i virtualbox VirtualBox-4.3-4.3.28_100309_el7-1.x86_64 # yum remove VirtualBox-4.3-4.3.28_100309_el7-1.x86_64