I just have to create a post about installing VirtualBox 5 on CentOS because I haven’t seen a good blog post about it at all.
The repository will update it self to newer versions when they are available, on the bottom of this post you’ll see the command to check available VirtualBox versions to install.
This is an extremely simple procedure so I’ll skip a long blog post. I’ll show you how to install VirtualBox in two ways:
Step 1 download VirtualBox repository directly to the yum repository
cd /etc/yum.repos.d/
Download the repository file directly from virtualbox.org
sudo wget http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo
Update yum before we install VirtualBox 5
sudo yum update -y
Install VirtualBox 5
sudo yum install VirtualBox-5.0
Step 2 create the repository list directly using vi editor
first create the file and open it in vi
vi /etc/yum.repos.d/virtualbox.repo
Press I to input text copy and paste the below text:
[virtualbox] name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch enabled=1 gpgcheck=1 gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc
Save and close the file
:wq
Update system
sudo yum update -y
Install VirtualBox
sudo yum install VirtualBox-5.0
###
If you have permission issues or if the kernel didn’t recompile correctly please run the following command
sudo /etc/init.d/vboxdrv setup
If you are looking for newer or older versions just check for available VitrualBox versions with the below command
sudo yum provides VirtualBox | grep VirtualBox
sudo yum provides VirtualBox | grep VirtualBox VirtualBox-4.3-4.3.18_96516_el7-1.x86_64 : Oracle VM VirtualBox Filename : /usr/bin/VirtualBox VirtualBox-4.3-4.3.20_96996_el7-1.x86_64 : Oracle VM VirtualBox Filename : /usr/bin/VirtualBox VirtualBox-4.3-4.3.22_98236_el7-1.x86_64 : Oracle VM VirtualBox Filename : /usr/bin/VirtualBox VirtualBox-4.3-4.3.24_98716_el7-1.x86_64 : Oracle VM VirtualBox Filename : /usr/bin/VirtualBox VirtualBox-4.3-4.3.26_98988_el7-1.x86_64 : Oracle VM VirtualBox Filename : /usr/bin/VirtualBox VirtualBox-4.3-4.3.28_100309_el7-1.x86_64 : Oracle VM VirtualBox Filename : /usr/bin/VirtualBox VirtualBox-4.3-4.3.30_101610_el7-1.x86_64 : Oracle VM VirtualBox Filename : /usr/bin/VirtualBox VirtualBox-5.0-5.0.0_101573_el7-1.x86_64 : Oracle VM VirtualBox Filename : /usr/bin/VirtualBox