All Linux HowTo's

Install VirtualBox on CentOS and RHEL

This article demonstrates how to install VirtualBox on CentOS 7 and RHEL systems.

cd /etc/yum.repos.d/
rpm -Uvh

Install required packages:

yum install gcc make patch  dkms qt libgomp
yum install kernel-headers kernel-devel fontforge binutils glibc-headers glibc-devel

Check where the kernel headers went. We need that for a “path” change shortly.

ls -l /usr/src/kernels/

I got the following:


Set a temporary path using the above result:

export KERN_DIR=/usr/src/kernels/3.10.0-327.36.3.el7.x86_64

Now install the VirtualBox packages:

yum install VirtualBox-5.1

At this point you will be asked which user you want to authenticate as. But if you’re setting up VirtualBox for use with Vagrant, you can end this process right here.

However, if you’re not doing this for Vagrant, continue on with the following command:

systemctl restart vboxdrv

Share This: