0

Im trying to get a vagrant virtualbox vmware/photon up and running but the most basic Vagrantfile emits an error.

    Vagrant.configure("2") do |config|
      config.vm.box = "vmware/photon" 
      config.vm.box_version = "4.0.2"
    end
Path: <provider config: virtualbox>
Line number: 19
Message: NameError: undefined local variable or method `override' for main:Object

        override.vbguest.no_install = true

One thing I tried was to set the override variable

Vagrant.configure("2") do |override, config|

But then a full callstack is thrown:

D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/config/v2/loader.rb:37:in `load': can't convert Vagrant::Config::V2::Root to Array (Vagrant::Config::V2::Root#to_ary gives Vagrant::Config::V2::DummyConfig) (TypeError)
        from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/config/loader.rb:126:in `block (2 levels) in load'
        from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/config/loader.rb:119:in `each'
        from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/config/loader.rb:119:in `block in load'
        from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/config/loader.rb:116:in `each'
        from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/config/loader.rb:116:in `load'
        from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/vagrantfile.rb:31:in `initialize'
        from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/environment.rb:817:in `new'
        from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/environment.rb:817:in `vagrantfile'
        from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/environment.rb:998:in `process_configured_plugins'
        from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/lib/vagrant/environment.rb:189:in `initialize'
        from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/bin/vagrant:211:in `new'
        from D:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-2.3.7/bin/vagrant:211:in `<main>'

How do we get photonos up and running with vagrant and virtualbox?

1 Answer 1

0

Day later I figured it out

The Vagrantfile from the photon box itself has a syntax error if you have vbguest additions already installed.

~/.vagrant.d/boxes/vmware-VAGRANTSLASH-photon/4.0.2/virtualbox/Vagrantfile

  config.vm.provider "virtualbox" do |v|
    if Vagrant.has_plugin?("vagrant-vbguest")
        override.vbguest.no_install = true
    end

The error is emitted when override is used on no_install = true.

undefined local variable or method `override' for main:Object

changing the provider to

config.vm.provider "virtualbox" do |v, override|

fixed it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.