Installing VirtualBox on CentOS 7

Category: Software and Systems Engineering
Author: Sean O'Donnell
Thu, Aug. 10th, 2017 @ 17:42:09 (MDT)

I recently had to help a co-worker get VirtualBox installed on his CentOS 7 linux workstation. While this is normally quite trivial, there were some packages that needed to be upgraded, and remote 3rd-party (public) repos that I had to install, as well.

Disclaimer: We are mostly a Linux workstation shop here, although we also have Windows on our laptops. The majority of developers here prefer to do everything on Linux, though. There are a few exceptions, whom I pray for. ;-P

Public RPM Repositories

As a rule of thumb, whenever I install a new instance of CentOS/RHEL/Fedora, I always install the 3rd-party (public) repositories that provide certain applications that aren't included in the distro repo.

For instance, the program 'htop' is not included in the distro repo. I heavily rely on this program for process tree monitoring and CPU/Memory monitoring, so this is generally the 1st program that I install manually. It is available in the EPEL repository.

The (3) main public repositories that I generally install/use, are as follows:

  • epel
  • rpmforge
  • rpmfusion

Installing Public RPM Repositories...

$ sudo yum install epel-release rpmforge-release
$ sudo rpm -i

Updating the Linux Kernel

When I attempted to install VirtualBox, I ran into some package dependency issues related to the kernel. At 1st I was hesitant to continue, but after further attempts to --skip-broken packages, I realized that there was no other option than to upgrade the kernel, so that VirtualBox could run VMs.

$ sudo yum install kernel kernel-debug

While years ago, I would have been very nervous that I'd hose my system trying to upgrade the kernel... these days... I have far more confidence in doing so via RPM packages. Some might argue that this is risky business, and they would be right, but I was willing to take the chance. This particular co-worker is brand new and his workstation could be easily re-installed without much loss, if the worst case scenario occurred.

Installing VirtualBox

Once I upgraded the kernel packages, I was able to get VirtualBox installed and running, without any errors or dependency issues.

$ sudo yum install VirtualBox

That all seemed to do the trick!

$ virtualbox

Yay, it works. Now he's able to install VMs at his own discretion.

Why use public repos?

Here at my work, we have a centralized repository that has been configured for our workstations. This is the original package archive shipped with the release back when they configured the kickstarts for our workstations. The problem is that they never update that repo, so any packages that come from public repos, often have package dependency conflicts, and I often find myself needing to use --disablerepo=ourlocalrepos*, in order to bypass these older packages, and get the latest via public repo.

I really wish they would update this local repo, but that's out of my hands! Thankfully, I'm one of the few people here with escalated sudo privileges, so I can take these matters into my own hands. The caveat being that by doing so, I take all 'support' related responsibility for my own workstation, but I'm not at the mercy of the desktop support group (which is generally overwhelmed by other departments), so that's a good thing.

Copyleft (<) 1998-2019