docker-machine(We support Virtualbox starting with version 5...)

[root@tom docker-demo]# docker-machine create --driver virtualbox default
Running pre-create checks...
Error with pre-create check: "We support Virtualbox starting with version 5. Your VirtualBox install is 
"WARNING: The vboxdrv kernel module is not loaded. Either there is no module
         available for the current kernel (3.10.0-957.21.3.el7.x86_64) or it failed to
        load. Please recompile the kernel module and install it by
           sudo /sbin/vboxconfig
         You will not be able to start VMs until this problem is fixed.
6.0.8r130520". Please upgrade at https://www.virtualbox.org"

docker-machine创建虚拟机时报错,提示运行/sbin/vboxconfig。

运行/sbin/vboxconfig

[root@tom docker-demo]# /sbin/vboxconfig 
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    kernel-devel kernel-devel-3.10.0-957.21.3.el7.x86_64
This system is currently not set up to build kernel modules.
Please install the Linux kernel "header" files matching the current kernel
for adding new hardware support to the system.
The distribution packages containing the headers are probably:
    kernel-devel kernel-devel-3.10.0-957.21.3.el7.x86_64

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.  If your system is using EFI Secure Boot you may need to sign the
kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load
them. Please see your Linux system's documentation for more information.

然后提示安装kernel-devel,输入y 一直等待执行完成

[root@tom docker-demo]# yum install kernel-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
....省略

再次 执行 /sbin/vboxconfig,如下则正常:

[root@tom docker-demo]# /sbin/vboxconfig 
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Starting VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.

如果还是提示安装kernel-devel,可能是由于uname -r的内核版本和安装的内核版本不一致导致的,

[root@tom demo04compose]# uname -r
3.10.0-693.21.1.el7.x86_64
[root@tom demo04compose]# ll /usr/src/kernels/
total 4
drwxr-xr-x 22 root root 4096 Jun 21 17:14 3.10.0-957.21.3.el7.x86_64
[root@tom demo04compose]# 

此时有两个方法,一个是将内核升级到安装的内核版本,参照: 我是参照

另一个是找到内核对应版本的kernel-devel安装,卸载原有版本。

只有再次执行/sbin/vboxconfig启动虚拟机

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值