On August 29th, 2022, we’ve announced Oracle VM VirtualBox 7.0 BETA release.

One important option for DevOps purposes, while using Oracle VM VirtualBox, is Vagrant; Vagrant and Vagrant Boxes allow to automate all the steps required to get VMs (and software on top) deployed on top of VirtualBox; actual latest release of Vagrant (2.3) does not recognize VirtualBox 7.0 as a provider.

The workaround to overcome this temporary limitation can be applied by following steps:

  • Edit “meta.rb” file, that can be identified at this path
    • Windows
C:\HashiCorp\Vagrant\embedded\gems\<vagrant-release>\gems\<vagrant-release>\plugins\providers\virtualbox\driver
  • Linux & MacOS
/opt/vagrant/embedded/gems/<vagrant-release>/gems/vagrant-<vagrant-release>/plugins/providers/virtualbox/driver
  • Add 7.0 within the “driver_map” list, as in the example below:
@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,
  "7.0" => Version_7_0,
  • Create “version_7_0.rb” file for VirtualBox 7 support in vagrant at this path:
    • Windows
C:\HashiCorp\Vagrant\embedded\gems\<vagrant-release>\gems\<vagrant-release>\plugins\providers\virtualbox\driver
  • Linux & MacOS
/opt/vagrant/embedded/gems/<vagrant-release>/gems/vagrant-<vagrant-release>/plugins/providers/virtualbox/driver

This file can be downloaded here.

  • Edit “plugin.rb” file, that can be identified at this path:
  • Windows
C:\HashiCorp\Vagrant\embedded\gems\<vagrant-release>\gems\<vagrant-release>\plugins\providers\virtualbox
  • Linux & MacOS
/opt/vagrant/embedded/gems/<vagrant-release>/gems/vagrant-<vagrant-release>/plugins/providers/virtualbox
  • Add 7.0 within the “module Driver” section, as in the example below:
    # 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__)
      autoload :Version_7_0, File.expand_path("../driver/version_7_0", __FILE__)
end

With those simple steps you’ll be able to get “Vagrant 2.3” and “Oracle VM VirtualBox 7.0 BETA releases” correctly working together while waiting for an official Vagrant Build that supports Oracle VM VirtualBox 7.0.

Hope it helps!