Answers: <p>Day later I figured it out</p>
  <p>The Vagrantfile from the photon box itself has a syntax error if you have vbguest additions already installed.</p>
  <p><code>~/.vagrant.d/boxes/vmware-VAGRANTSLASH-photon/4.0.2/virtualbox/Vagrantfile</code></p>
  <pre><code>  config.vm.provider &quot;virtualbox&quot; do |v|
      if Vagrant.has_plugin?(&quot;vagrant-vbguest&quot;)
          override.vbguest.no_install = true
      end
  </code></pre>
  <p>The error is emitted when override is used on no_install = true.</p>
  <p><code>undefined local variable or method `override' for main:Object</code></p>
  <p>changing the provider to</p>
  <pre><code>config.vm.provider &quot;virtualbox&quot; do |v, override|
  </code></pre>
  <p>fixed it</p>
  
Answers: CC BY-SA 4.0
Answers: 2023-09-22T11:42:24.027Z
Answers: 2023-09-22T11:42:24.027Z
Answers: Serve Laurijssen
Body: <p>Im trying to get a vagrant virtualbox  vmware/photon up and running but the most basic Vagrantfile emits an error.</p>
  <pre><code>    Vagrant.configure(&quot;2&quot;) do |config|
        config.vm.box = &quot;vmware/photon&quot; 
        config.vm.box_version = &quot;4.0.2&quot;
      end
  </code></pre>
  <pre><code>Path: &lt;provider config: virtualbox&gt;
  Line number: 19
  Message: NameError: undefined local variable or method `override' for main:Object
  
          override.vbguest.no_install = true
  </code></pre>
  <p>One thing I tried was to set the override variable</p>
  <p><code>Vagrant.configure(&quot;2&quot;) do |override, config|</code></p>
  <p>But then a full callstack is thrown:</p>
  <pre><code>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 `&lt;main&gt;'
  </code></pre>
  <p>How do we get photonos up and running with vagrant and virtualbox?</p>
  
Tags: <kubernetes><vagrant><virtualization><virtualbox>
Title: vmware/photon with vagrant and virtualbox provider
UserDisplayName: Serve Laurijssen
ThreadText: # vmware/photon with vagrant and virtualbox provider
  
  (Asked by: username_0 on 2023-09-21)
  
  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?
  
  **Tags:** kubernetes, vagrant, virtualization, virtualbox
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2023-09-22. Score: 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
  
  
  ---
  
  