Vagrant: Undefined method traceback instead of error message when running vagrant w/o virtualbox

Created on 16 Jun 2016  路  14Comments  路  Source: hashicorp/vagrant

Vagrant Version

Vagrant 1.8.4
_Note that the ultimate problem is that I forgot to install Virtualbox on a fresh Windows install._

Host operating system
Windows 10 Enterprise, latest stable and also Insider Preview 14342.rs1_release.160506-1708

Guest operating system

Vagrantfile

Default from vagrant init

Debug output

Can't easily get this now that I've fixed the problem, if this is required to fix I can probably reproduce this in a Windows 10 VM.

Expected behavior

It should fail with "Virtualbox is required" or "A VM provider is required" or some other

Actual behavior

C:\Users\Timothy>vagrant up
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/platform.rb:85:in `block in windows_hyperv_admin?': undefined method `include?' for #<Vagrant::Util::Subprocess::Result:0x2de92e0> (NoMethodError)
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/platform.rb:89:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/platform.rb:89:in `windows_hyperv_admin?'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/hyperv/provider.rb:20:in `usable?'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:381:in `block in default_provider'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:379:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:379:in `default_provider'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/plugin/v2/command.rb:174:in `block in with_target_vms'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/plugin/v2/command.rb:201:in `call'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/plugin/v2/command.rb:201:in `block in with_target_vms'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/plugin/v2/command.rb:183:in `each'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/plugin/v2/command.rb:183:in `with_target_vms'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/commands/up/command.rb:131:in `install_providers'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/commands/up/command.rb:85:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/cli.rb:42:in `execute'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:302:in `cli'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/bin/vagrant:174:in `<main>'

Steps to reproduce

  1. Fresh install of Windows
  2. Don't install Virtualbox
  3. Install Vagrant
  4. vagrant init
  5. vagrant up

    References

Worth noting that googling for the traceback didn't give me any helpful resources. Hopefully just creating this bug will fix that!

bug core

Most helpful comment

Hi all,
I got the same problem after installing virtualbox 5.1 but thanks to issue #5572 I got it working with vagrant 1.8.4 and virtualbox 5.1.
Here is what I did:

  • Step 1: Dupliate the file named version_5_0.rb in c:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.8.4\plugins\providers\virtualbox\driver and rename the new one to version_5_1.rb
  • Step 2: Modify this file (version_5_1.rb) by replacing 5_0 with 5_1 in lines 11 and 15
  • Step 3: Modify the "meta.rb" file in the same folder by adding the following after line 63:
    "5.1" => Version_5_1,
  • Step 4: Modify the plugin.rb file located in the providers\virtualbox directory (up one directory from where we were) and add the following after line 58:
    autoload :Version_5_1, File.expand_path("../driver/Version_5_1", __FILE__)

Hope it helps.

Have a nice day,

Mohsen

All 14 comments

Thank you! :heart:

thanks! installing virtualbox solved it, just as you had recommended.

Installing VirtualBox also worked for me. So this bug is either a problem with the installer (did not install required components) or a problem with the doc/site (did not mention the need to install VirtualBox separately)

I have VirtualBox installed and I'm getting this error. :(

Same here,
I try uninstall and reinstall it, but it麓s not working.

Fresh install of Vagrant and VirtualBox. I am getting this error when running vagrant up.

I had the same issue (initially thought it was because of Hyper-V, which I already uninstalled and the errors remained). But if you installed Virtualbox today, the issue is probably because 5.1 has just been released a few hours ago (creating an environment variable VAGRANT_DEFAULT_PROVIDER set to "virtualbox" shows a message that says it only supports up to 5.0).

Uninstall 5.1, and install Virtualbox 5.0.24 instead until that issue is closed, that fixed it for me.

Thank you @cecilemuller, that fixed it for me.

worked for me as well... just providing some reassurance
Thank you @cecilemuller

@cecilemuller Thank you for providing detailed answer. It fixed the issue for me!! :)

Thanks a lot @cecilemuller... I was getting the same error (VBox 5.1, Vagrant 1.8.4). I uninstalled and reinstalled VirtualBox 5.0.24, and it works!

Same thing; 5.1 Virtualbox borks it up on vagrant 1.8.4. Uninstalled 5.1, install 5.024, and it works. I hope this gets fixed soon.

https://www.virtualbox.org/wiki/Download_Old_Builds_5_0

NOTE: If you get:

"rsync" could not be found on your PATH. Make sure that rsync
is properly installed on your system and available on the PATH."

That means you're still using the 5.1 extension pack. You must remove that, and manually install the one that comes with 5.024.

Hi all,
I got the same problem after installing virtualbox 5.1 but thanks to issue #5572 I got it working with vagrant 1.8.4 and virtualbox 5.1.
Here is what I did:

  • Step 1: Dupliate the file named version_5_0.rb in c:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.8.4\plugins\providers\virtualbox\driver and rename the new one to version_5_1.rb
  • Step 2: Modify this file (version_5_1.rb) by replacing 5_0 with 5_1 in lines 11 and 15
  • Step 3: Modify the "meta.rb" file in the same folder by adding the following after line 63:
    "5.1" => Version_5_1,
  • Step 4: Modify the plugin.rb file located in the providers\virtualbox directory (up one directory from where we were) and add the following after line 58:
    autoload :Version_5_1, File.expand_path("../driver/Version_5_1", __FILE__)

Hope it helps.

Have a nice day,

Mohsen

I got around this with the following method:

1) Uninstall the latest versions of VirtualBox and Vagrant.
2) Install VirtualBox v5.0.18
3) Install Vagrant v1.8.1
4) Execute vagrant commands using an administrative-level powershell session.

The combination of all of this has everything working for me. I went with those versions by contacting a friend of mine who works with Vagrant professionally and asking him what versions he was using.

Was this page helpful?
0 / 5 - 0 ratings