Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling GUI on Vagrant VirtualBox - undefined local variable

I'm new to vagrant/homestead, and I'm trying to debug the box that was created using vagrant up as the connection is on a timeout loop. I'm trying to enable the GUI. I've tried adding the config from the vagrant site and every variation of it to my vagrantfile:

config.vm.provider "virtualbox" do |v|
  v.gui = true
end

But whenever this is in there and I run vagrant up or reload, it just returns "Message: undefined local variable or method 'config' for main:Object"

Any ideas? Thanks in advance!

like image 975
nwi_justin Avatar asked Oct 20 '25 02:10

nwi_justin


1 Answers

Recently I had the same problem, in my case this is because I put this code outside the main vagrant config block, try to put in the proper place like in example. First line define local variable config which used inside the block:

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  // other configs

  config.vm.provider "virtualbox" do |v|
    v.gui = true
  end

end
like image 75
Sonique Avatar answered Oct 21 '25 22:10

Sonique



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!