install virtualbox on centos server

This article introduces how to download and install virtualbox on centos 7.2 server, and record the problems encountered:

And the process of solving problems by yourself.

Env

Add repo url

cd /etc/yum.repos.d
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo

install denpendiencies

yum --enablerepo=epel install dkms

install epel

CentOS/RHEL 7,64Bit(x86_64):
# rpm -Uvh http://epel.mirror.net.in/epel/7/x86_64/e/epel-release-7-8.noarch.rpmCentOS/RHEL 6,64Bit(x86_64):
# rpm -Uvh http://epel.mirror.net.in/epel/6/x86_64/epel-release-6-8.noarch.rpm

An error was reported at this step: the url could not be found. The author copied the url to the browser and found that there is no such link. But I found another link under the warehouse:

http://epel.mirror.net.in/epel/7/x86_64/e/epel-release-7-9.noarch.rpm

Just replace it.

Install kernel-devel

sudo yum install kernel-devel

Kernel-devel is the kernel (kernel) source code and will be installed under the /usr/src/kernels directory by default. The kernel source code is needed. It is because virtualbox needs to compile a specific kernel version module with the kernel source code.

The problem I encountered is that the version of yum install kernel-devel is inconsistent with the version of the kernel on CentOS. As follows (the following results are listed after the author has solved all the problems, you can see that the uninstalled version 3.10.0-514.2.2.el7 is inconsistent with the host version):

➜  alpine uname -r                  
3.10.0- 327.36.3. el7.x86_64
➜  alpine sudo yum list kernel-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.0x.sg
* epel: mirror.smartmedia.net.id
* extras: mirror.0x.sg
* updates: mirror.0x.sg
Installed Packages
kernel-devel.x86_64                       3.10.0-327.36.3.el7                       installed
Available Packages
kernel-devel.x86_64                       3.10.0-514.2.2.el7                        updates

This leads to inconsistencies between the compiled and installed virtualbox module and the host kernel version and cannot run.

There are two broad categories of solutions:

Finally, I decided to download the kernel source code of the version. Proceed as follows:

List pkg

~ yum search virtualbox
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: centos.usonyx.net
* epel: mirrors.tuna.tsinghua.edu.cn
* extras: centos.usonyx.net
* updates: centos.usonyx.net
virtualbox                                                                                                                                                                             31/31
VirtualBox-4.3.x86_64 : Oracle VM VirtualBox
VirtualBox-5.0.x86_64 : Oracle VM VirtualBox
VirtualBox-5.1.x86_64 : Oracle VM VirtualBox

Install

yum install VirtualBox-5.1

Recommended Posts

install virtualbox on centos server
Install Nginx server on CentOS 7
VirtualBox install centos7
How to install Virtualbox on CentOS 8
Install Docker on Centos7
install LNMP on centos7.4
Nodejs install on centos7
Install FFmpeg on CentOS 8
Install RabbitMQ on CentOS 7
Install Node.js on Centos
VirtualBox install CentOS system
Maven install on centos7
Install MongoDB on CentOS 7
CentOS 6.X install VirtualBox-5.1
Install Surelog on CentOS8
Openjdk install on centos7
Install Jenkins on centos7
Install RabbitMQ on CentOS 7
install Docker on centos6.5
install oracle on centos
Install Elasticsearch 6 on centos7
Install RabbitMQ on CentOS7
How to install VirtualBox client extension on CentOS 8
Install mysql online on centos
Install OpenSSL 1.0.2 on Ubuntu Server 14.04
Install ElasticSearch 7.x on CentOS 7
Install MySQL 8.0.16 on Linux Centos
Install docker transfer on Centos7
Install docker on Centos system
install EPEL repo on centos
Install Zabbix 3.4 based on CentOS 7
How to install and configure NFS server on CentOS 8
1.5 Install Centos7
How to install MySQL on CentOS 8
Install JDK8 in rpm on CentOS7
How to install Memcached on CentOS 8
Install MATE or XFCE on CentOS 7
How to install VirtualBox on Ubuntu 20.04
How to install R on CentOS 8
How to install FFmpeg on CentOS 8
How to install TensorFlow on CentOS 8
How to install TeamViewer on CentOS 8
Install Chef server workstation on Ubuntu 18.04
How to install Perl 5 on CentOS
Tencent Cloud Centos7 install java server
How to install Git on CentOS 8
How to install Gradle on CentOS 8
How to install Elasticsearch on CentOS 8
How to install Jenkins on CentOS 8
How to install Java on CentOS 8
How to install Go on CentOS 8
Tencent Cloud Centos7 install java server
How to install GCC on CentOS 8
Install Percona Server database (in CentOS 8)
How to install Yarn on CentOS 8
How to install Nginx on CentOS 8
How to install Asterisk on CentOS 7
How to install Jenkins on CentOS 8
Install MySQL on Linux CentOS7 (Windows)
How to install Vagrant on CentOS 8
How to install Python 3.8 on CentOS 8