Description
VirtualBox 6.1.0 has been released. Unfortunately, Vagrant 2.2.6 doesn't work with this new release. This isn't an issue with this repository, but it may affect people using these boxes. It should be fixed in the next release of Vagrant (see hashicorp/vagrant#11249), but here's how to work around the problem in the meantime.
Credits:
- @scoter-oracle blogged about a very similar issue last year.
- @briancain has developed a fix for the next Vagrant release (see briancain/vagrant@fb4e698)
The workaround requires 3 changes.
First, in the file /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/plugin.rb
, add a line at the end of the Driver module for VirtualBox 6.1, as follows. (On Windows, the file location is C:\HashiCorp\Vagrant\embedded\gems\2.2.6\gems\vagrant-2.2.6\plugins\providers\virtualbox\plugin.rb
.)
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
Second, in the file /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/driver/meta.rb
, add a line at the end of the driver_map section for VirtualBox 6.1, as follows. (On Windows, the file location is C:\HashiCorp\Vagrant\embedded\gems\2.2.6\gems\vagrant-2.2.6\plugins\providers\virtualbox\driver\meta.rb
.)
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,
}
Finally, create a new file called version_6_1.rb
in the directory /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/driver
. (On Windows, create this file in the folder C:\HashiCorp\Vagrant\embedded\gems\2.2.6\gems\vagrant-2.2.6\plugins\providers\virtualbox\driver
.) In this new file, paste the content from here.
With these 3 changes, Vagrant 2.2.6 will work with VirtualBox 6.1.0. I hope this helps!
Activity
piotr-cz commentedon Dec 12, 2019
Thanks for sharing!
MasterCATZ commentedon Dec 13, 2019
Thank you
RvstFyth commentedon Dec 16, 2019
Nice, thanks for the workaround!
For Arch linux the paths where a bit different though:
/opt/vagrant/embedded/gems/gems/vagrant-2.2.6/plugins/providers/virtualbox/plugin.rb
/opt/vagrant/embedded/gems/gems/vagrant-2.2.6/plugins/providers/virtualbox/driver/meta.rb
jonroberts24 commentedon Dec 16, 2019
Do you know when the next version that will work with VirtualBox will be out? Are we talking weeks / months? thanks
PaulNeumann commentedon Dec 16, 2019
@jonroberts24 Only the Vagrant team can answer that. The only indication I've seen is @briancain's comment on the issue in the Vagrant repository.
Michael-Ziluck commentedon Dec 16, 2019
@PaulNeumann When I perform the steps you mentioned, I get the following error message:
Any ideas how I might get this resolved without disabling the bidirectional clipboard?
PaulNeumann commentedon Dec 16, 2019
@ZiluckMichael I don't know; I'm sorry. I suggest asking in the hashicorp/vagrant repository. The thread for the VirtualBox 6.1.0 issue is at hashicorp/vagrant#11249.
scoter-oracle commentedon Dec 16, 2019
While waiting for a fix from Vagrant you can apply that change manually by using "VBoxManage" CLI:
vboxmanage modifyvm <uuid/name> --clipboard-mode bidirectional
The option "--clipboard" has changed to "--clipboard-mode" on 6.1 VirtualBox release.
armenr commentedon Dec 17, 2019
Wow. The first post of this issue saved my butt.
When can we expect a stable update from the Vagrant team?
scoter-oracle commentedon Dec 17, 2019
@karlbunch consider my update above for the Vagrant release supporting VirtualBox 6.1.0 (related to the clipboard change)
paolodenti commentedon Dec 22, 2019
thank you
Redsandro commentedon Dec 23, 2019
Thank you 👍
Don't forget the newly created file needs to be readable by all (e.g.
644
), in case you have a differentumask
when runningsudo
.41 remaining items