Part 2 – Install VirtualBox on CentOS 7

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.

cd /etc/yum.repos.d/
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
rpm -Uvh http://ftp.jaist.ac.jp/pub/Linux/Fedora/epel/7/x86_64/e/epel-release-7-7.noarch.rpm

1

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

2

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
/usr/lib/virtualbox/vboxdrv.sh setup

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!

Part 1 – Install Vagrant on CentOS 7

Part 2 – Install VirtualBox on CentOS 7

Part 3 – Running a VM with Vagrant

Part 4 – Add,Update and Remove a Box in Vagrant

Part 5 – Running Multiple VMs using Vagrant

 

Advertisements

#centos-7, #vagrant, #virtualbox