After having installed Vagrant on CentOS, i needed VirtualBox to be installed on top of that for the Vagrant to be up and running. Vagrant supports other virtualization providers also like VMware which needs to be installed separately via the plugins and they would need a commercial license to be purchased. Since VirutalBox is free, i decided to go ahead with it.
Download the VirtualBox repository and EPEL yum repository to the /etc/yum.repos.d directory, use below as sudo user.
rpm -Uvh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/7/x86_64/e/epel-release-7-7.noarch.rpm
Install the required packages like kernel-headers, kernel-devels that are needed for the VirtualBox to run.
yum install gcc make patch dkms qt libgomp
yum install kernel-headers kernel-devel fontforge binutils glibc-headers glibc-devel
Set the KERN_DIR environmental variables to point to the kernel source code, this is needed for the VirtualBox installation. Look for the kernel sources in /usr/src/kernels directory. Use the below command to point the kernel source code to the variable.
# export KERN_DIR=/usr/src/kernels/3.10.0-327.22.2.el7.x86_64
Now install VirtualBox using the below and it should download a 80-100MB file.Once done, rebuild the kernel modules
yum install VirtualBox-5.0
Add VirtualBox users (vmmaster in my case) to the vboxuser group and reboot the machine.
usermod –a –G vboxusers vmmaster
All set! VirtualBox is now ready to run. Hope this was informative. Thanks!