当前位置:网站首页>Vagrant2.2.6 supports virtualbox6.1

Vagrant2.2.6 supports virtualbox6.1

2022-07-05 19:09:00 51CTO


It's not easy to install vagrant2.2.6, As a result, I used the latest virtualbox6.1 Version of , The result does not support .
An error is as follows :
One is mine virtual Installation is too advanced , Currently not supported . But I don't want to uninstall and then install again . So I really found a solution on the Internet , Change the configuration , Add a few files and it will be .

      
      
$ vagrant up
The provider 'virtualbox' that was requested to back the machine homestead' 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.
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.

original text :​ ​https://blogs.oracle.com/scoter/getting-vagrant-226-working-with-virtualbox-61-ga​

      
      
D:\HashiCorp\Vagrant\embedded\gems\2.2.6\gems\vagrant-2.2.6\plugins\providers\virtualbox\driver
  • 1.

increase 6.1 Support for :

modify

      
      
vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/driver/meta.rb
  • 1.

increase 6.1:

      
      
@logger.debug("Finding driver for VirtualBox version: #{@@version}")

driver_map = {

"4.0" => Version_4_0,

"4.1" => Version_4_1,

"4.2" => Version_4_2,

"4.3" => Version_4_3,

"5.0" => Version_5_0,

"5.1" => Version_5_1,

"5.2" => Version_5_2,

"6.0" => Version_6_0,

"6.1" => Version_6_1,

}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.

Then create 6.1 Corresponding file :

      
      
vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/driver/version_6_1.rb
  • 1.

Change the content as follows :

      
      
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
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.

increase “module Driver”

      
      
vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/plugin.rb
  • 1.
      
      
# Drop some autoloads in here to optimize the performance of loading

# our drivers only when they are needed.

module Driver

autoload :Meta, File.expand_path("../driver/meta", __FILE__)

autoload :Version_4_0, File.expand_path("../driver/version_4_0", __FILE__)

autoload :Version_4_1, File.expand_path("../driver/version_4_1", __FILE__)

autoload :Version_4_2, File.expand_path("../driver/version_4_2", __FILE__)

autoload :Version_4_3, File.expand_path("../driver/version_4_3", __FILE__)

autoload :Version_5_0, File.expand_path("../driver/version_5_0", __FILE__)

autoload :Version_5_1, File.expand_path("../driver/version_5_1", __FILE__)

autoload :Version_5_2, File.expand_path("../driver/version_5_2", __FILE__)

autoload :Version_6_0, File.expand_path("../driver/version_6_0", __FILE__)

autoload :Version_6_1, File.expand_path("../driver/version_6_1", __FILE__)

end
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.


原网站

版权声明
本文为[51CTO]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207051833079589.html