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

参考文章

《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
《L01 基础入门》
我们将带你从零开发一个项目并部署到线上,本课程教授 Web 开发中专业、实用的技能,如 Git 工作流、Laravel Mix 前端工作流等。
讨论数量: 6

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

5年前 评论

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

5年前 评论

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

4年前 评论

终于解决了。。。。

4年前 评论

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

4年前 评论

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

4年前 评论