Skip to content

Vagrant 2.2.6 doesn't work with VirtualBox 6.1.0 #178

Description

@PaulNeumann

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:

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

  1. piotr-cz commented on Dec 12, 2019

    @piotr-cz

    Thanks for sharing!

  2. MasterCATZ commented on Dec 13, 2019

    @MasterCATZ

    Thank you

  3. RvstFyth commented on Dec 16, 2019

    @RvstFyth

    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

  4. jonroberts24 commented on Dec 16, 2019

    @jonroberts24

    Do you know when the next version that will work with VirtualBox will be out? Are we talking weeks / months? thanks

  5. PaulNeumann commented on Dec 16, 2019

    @PaulNeumann
    ContributorAuthor

    @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.

  6. Michael-Ziluck commented on Dec 16, 2019

    @Michael-Ziluck

    @PaulNeumann When I perform the steps you mentioned, I get the following error message:

    A customization command failed:
    
    ["modifyvm", :id, "--clipboard", "bidirectional"]
    
    The following error was experienced:
    
    #<Vagrant::Errors::VBoxManageError: There was an error while executing `VBoxManage`, a CLI used by Vagrant
    for controlling VirtualBox. The command and stderr is shown below.
    
    Command: ["modifyvm", "ce8a3576-201c-11ea-978f-2e728ce88125", "--clipboard", "bidirectional"]
    

    Any ideas how I might get this resolved without disabling the bidirectional clipboard?

  7. PaulNeumann commented on Dec 16, 2019

    @PaulNeumann
    ContributorAuthor

    @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.

  8. scoter-oracle commented on Dec 16, 2019

    @scoter-oracle
    Member

    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.

  9. armenr commented on Dec 17, 2019

    @armenr

    Wow. The first post of this issue saved my butt.

    When can we expect a stable update from the Vagrant team?

  10. scoter-oracle commented on Dec 17, 2019

    @scoter-oracle
    Member

    @karlbunch consider my update above for the Vagrant release supporting VirtualBox 6.1.0 (related to the clipboard change)

  11. paolodenti commented on Dec 22, 2019

    @paolodenti

    thank you

  12. Redsandro commented on Dec 23, 2019

    @Redsandro

    Thank you 👍

    Don't forget the newly created file needs to be readable by all (e.g. 644), in case you have a different umask when running sudo.

  13. jimfrenette commented on Dec 27, 2019

    @jimfrenette

    Thanks for this!
    In fedora 31, the paths are:
    /usr/share/vagrant/gems/gems/vagrant-2.2.6/plugins/providers/virtualbox/plugin.rb
    /usr/share/vagrant/gems/gems/vagrant-2.2.6/plugins/providers/virtualbox/driver/meta.rb

  14. 16 remaining items

  15. rbreaves commented on Jan 23, 2020

    @rbreaves

    I think you are better off remapping 6.1 to 6.0. I have several plugins that need to initialize as well and I think they fail due to the mapping of 6.1 to 6.1.

    macOS: /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/driver/meta.rb
    Windows: C:\HashiCorp\Vagrant\embedded\gems\2.2.6\gems\vagrant-2.2.6\plugins\providers\virtualbox\driver\meta.rb

    "6.1" => Version_6_0,
    
  16. yveshwang commented on Jan 23, 2020

    @yveshwang

    Thank you!

  17. adeoke commented on Jan 28, 2020

    @adeoke

    Vagrant 2.2.7 now released. Appears to resolve my problem with virtualbox 6.1.x not being recognised.

  18. machielg commented on Jan 28, 2020

    @machielg

    Fixed with GH-11250

    Vagrant 2.2.7 now released. Appears to resolve my problem with virtualbox 6.1.x not being recognised.

  19. scoter-oracle commented on Jan 28, 2020

    @scoter-oracle
    Member

    Vagrant 2.2.7 adds support for VirtualBox 6.1 - https://github.com/hashicorp/vagrant/blob/v2.2.7/CHANGELOG.md
    Closing the issue.

  20. timka commented on Feb 3, 2020

    @timka

    2.2.7 doesn't work for me

    $ vagrant up
    Bringing machine 'default' up with 'virtualbox' provider...
    ==> default: Checking if box 'kane_project/windows-10' version '1903' is up to date...
    ==> default: Clearing any previously set forwarded ports...
    ==> default: Clearing any previously set network interfaces...
    ==> default: Preparing network interfaces based on configuration...
        default: Adapter 1: nat
    ==> default: Forwarding ports...
        default: 3389 (guest) => 3389 (host) (adapter 1)
        default: 5985 (guest) => 55985 (host) (adapter 1)
        default: 5986 (guest) => 55986 (host) (adapter 1)
        default: 22 (guest) => 2222 (host) (adapter 1)
    ==> default: Running 'pre-boot' VM customizations...
    A customization command failed:
    
    ["modifyvm", :id, "--clipboard", "bidirectional"]
    
    The following error was experienced:
    
    #<Vagrant::Errors::VBoxManageError: There was an error while executing `VBoxManage`, a CLI used by Vagrant
    for controlling VirtualBox. The command and stderr is shown below.
    
    Command: ["modifyvm", "ce2ae2de-d509-46e4-82ac-11df167cf2d5", "--clipboard", "bidirectional"]
    
    Stderr: Oracle VM VirtualBox Command Line Management Interface Version 6.1.2
    (C) 2005-2020 Oracle Corporation
    All rights reserved.
    
    Usage:
    # ...
    
    VBoxManage: error: Unknown option: --clipboard
    >
    
    Please fix this customization and try again.
    
    $ vagrant -v
    Vagrant 2.2.7
    
  21. scoter-oracle commented on Feb 3, 2020

    @scoter-oracle
    Member

    @timka this issue has to be reported to the vagrant-project. I already shared this issue with them but it seems that the same had been ignored.

  22. timka commented on Feb 4, 2020

    @timka

    @scoter-oracle Ah, wrong issue. Sorry for that

  23. scoter-oracle commented on Feb 4, 2020

    @scoter-oracle
    Member

    @timka I've talked with Vagrant guys, it seems that the "clipboard" mode is not an option managed by Vagrant but custom-code that you have into your box definition. So, you can evaluate to change the "--clipboard" to "--clipboard-mode" into your code. BTW, I've also talked with VBox engineering and we'll get back the support for also the older syntax. Thanks

  24. dkalaluhi commented on Feb 25, 2020

    @dkalaluhi

    Still an issue on fedora 31 with the repo version they have. Workaround does indeed work, but in the end, too many wonky things going on...just ended up going with 2.2.7 and fixed everything

  25. ashish-banjare commented on Mar 1, 2020

    @ashish-banjare

    /opt/vagrant/embedded/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- /opt/vagrant/embedded/gems/2.2.6/gems/vagrant-2.2.6/plugins/providers/virtualbox/driver/meta (LoadError)

    i am getting this error when run vagrant uo command in ubuntu 18.04

    and i also give 644 permission to new created file

  26. mojili commented on May 15, 2020

    @mojili

    @PaulNeumann
    Thank you. The provided solution was great

  27. HenryPineda commented on Oct 5, 2020

    @HenryPineda

    Thanks for sharing. It worked for me!

  28. blecx commented on May 8, 2021

    @blecx

    Hi,

    on debian the pathes are:

    /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/providers/virtualbox/driver/meta.rb 
    /usr/share/rubygems-integration/all/gems/vagrant-2.2.3/plugins/providers/virtualbox/driver/version_6_1.rb 
    

    rest as decribed

    vagrant init centos/7
    vagrant up --provider virtualbox

    I only needed to call vagrant up twice. Who knows why...

    works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions