centos7上安装VirtualBox5.0

2020-07-02 22:07:32 浏览数 (1)

  • 一、环境准备
  • 二、centos7安装virtualbox
  • 三、参考文档
  • 五、感悟

一、环境准备

1.0、前情摘要

有感于在centos7上安装minikube,安装VirtualBox总是启动失败, 参考很多文档都是yum update的方式,真心不想升级内核,所以做下记录

1.1、环境相关

CentOS Linux release 7.2.1511 (Core) uname -r: 3.10.0-327.el7.x86_64 docker-ce: 1.13.1-cs7 VirtualBox-5.0.x86_64

二、centos7安装virtualbox

2.0、注意事项

You need kernel-devel installed and you need, at least a C compiler plus some other bits. The version of kernel-devel that you install must have the exact same version number as your running kernel so the easiest way is to make sure you run yum update first then reboot into the new kernel then install kernel-devel.也就是说kernel-devel版本要和uname -r的版本一致 所以不要随意yum install kernel-devel

2.1、准备依赖

下载和内核版本对应的kernel-devel wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/kernel-headers-3.10.0-327.el7.x86_64.rpm wget http://vault.centos.org/7.2.1511/os/x86_64/Packages/kernel-devel-3.10.0-327.el7.x86_64.rpm yum localinstall kernel-devel-3.10.0-327.el7.x86_64.rpm kernel-headers-3.10.0-327.el7.x86_64.rpm yum install dkms

2.2、安装virtualbox

wget -P /etc/yum.repos.d http://download.virtualbox.org/virtualbox/rpm/el/virtualbox.repo yum install VirtualBox-5.0.x86_64

2.3、启动virtualbox[启动失败的话,重启机器]

KERN_DIR=/usr/src/kernels/`uname -r` export KERN_DIR /usr/lib/virtualbox/vboxdrv.sh setup

三、参考文档

3.1、参考文档

Unable to start Virtual Box in centOS 6: https://www.centos.org/forums/viewtopic.php?t=47687 VirtualBox Guest Additions on Fedora 26/25, CentOS/RHEL 7.3/6.9/5.11: https://www.if-not-true-then-false.com/2010/install-virtualbox-guest-additions-on-fedora-centos-red-hat-rhel/

0 人点赞