Vagrant 启动时报错

The provider 'virtualbox' that was requested to back the machine
'homestead-7' is reporting that it isn't usable on this system. The
reason is shown below:

Vagrant has detected that you have a version of VirtualBox installed
that is not supported by this version of Vagrant. Please install one of
the supported versions listed below to use Vagrant:

4.0, 4.1, 4.2, 4.3, 5.0, 5.1, 5.2, 6.0

A Vagrant update may also be available that adds support for the version
you specified. Please check www.vagrantup.com/downloads.html to download
the latest version.

我的vagrant版本是2.2.6
virtualbox版本号是6.1

vargrant不支持当前vbox版本

解决方案

  1. 重装一个低版本的virtualbox
  2. 或者修改vargrant的配置

这里重点介绍第二个方案:

  1. 修改

    sudo vim /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/plugin.rb

    添加一行如下图
    添加一行如下图

  2. 修改meta.rb

    sudo vim /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/driver/meta.rb

    这是vagrant在mac上的默认安装路径,window自己找一下

添加一行"6.1" => Version_6_1

  1. 同时在/opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/driver/目录下新建version_6_1.rb文件,文件内容如下:

    require File.expand_path("../version_6_0", __FILE__)
    module VagrantPlugins
    module ProviderVirtualBox
    module Driver
      # Driver for VirtualBox 6.1.x
      class Version_6_1 < Version_6_0
        def initialize(uuid)
          super
    
          @logger = Log4r::Logger.new("vagrant::provider::virtualbox_6_1")
        end
      end
    end
    end
    end
  2. 尝试启动vagrant
    vagrant up

参考文章

《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 6

真的可以。谢谢解决了大问题 :kissing_heart:

3年前 评论

up大赞,解决问题了,谢谢

3年前 评论

给你32个暴击 比须赞 差点就重新安装一次了

3年前 评论

终于解决了。。。。

3年前 评论

在safari浏览器上没有办法正常加载图片,出现这个问题的可以用chrome打开这个文章

3年前 评论

确实 能解决问题。。。 感谢感谢

3年前 评论

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!