Update the system to the latest version.
yum update
Reboot the system.
reboot
Once the system is up, install header and development tools.
yum install -y kernel-devel kernel-headers gcc make perl
Also, install the wget package to download items using the terminal.
yum -y install wget
Download the Oracle public key.
wget https://www.virtualbox.org/download/oracle_vbox.asc
Import Oracle public key.
rpm --import oracle_vbox.asc
Download the VirtualBox repository file for CentOS 7 / RHEL 7 and move it into /etc/yum.repos.d/ directory.
wget http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo -O /etc/yum.repos.d/virtualbox.repo
OR
Create the /etc/yum.repos.d/virtualbox.repo file with the following repository information.
[virtualbox] name=Oracle Linux / RHEL / CentOS-$releasever / $basearch - VirtualBox baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc
Install VirtualBox using the yum command.
VirtualBox v6.0:
yum install -y VirtualBox-6.0
VirtualBox v5.2:
yum install -y VirtualBox-5.2
Run the below command to check the status of VirtualBox Linux kernel module service.
systemctl status vboxdrv
博客介绍了在CentOS 7 / RHEL 7系统上安装VirtualBox的步骤。先将系统更新到最新版本并重启,安装头文件和开发工具以及wget包,接着下载并导入Oracle公钥,下载或创建VirtualBox仓库文件,最后使用命令安装VirtualBox,还可检查其内核模块服务状态。
1939

被折叠的 条评论
为什么被折叠?



