1

For tests in Testkitchen I use Vagrant base box with an older version of VirtualBox guest additions. So every time I run tests it updates guest additions first

==> default: Machine booted and ready!                                                                                                     
[default] GuestAdditions versions on your host (5.1.28) and guest (5.0.8) do not match. 

I do not need this update because mounting filesystem actually works with no problem. I would like to disable it.

I quickly checked the docs for kitchen-vagrant and disabled VBox additions update by creating VagranfileKitchen.rb with:

Vagrant.configure("2") do |config|
  config.vbguest.auto_update = false
end

and by adding to .kitchen.yml:

driver:
  name: vagrant
  vagrantfiles:
    - VagrantfileKitchen.rb

I wonder if there is a cleaner way without additional files? Thanks

Kirill
  • 6,762
  • 4
  • 51
  • 81

1 Answers1

1

Honestly I think the best solution is to update your base box regularly. But if you don't want to do that, then you can add this to your ~/vagrant.d/Vagrantfile:

Vagrant.configure("2") do |config|
  config.vbguest.auto_update = false
end

This way you don't need to add anything to .kitchen.yml, which makes this method marginally simpler than your given solution, with the caveat that it will affect all of your Vagrant boxes, and not just your TestKitchen boxes.

jayhendren
  • 4,286
  • 2
  • 35
  • 59
  • I will have to do it on every machine, or everyone who clones the repo. I still think that my solution is better :| – Kirill Oct 05 '17 at 22:38
  • 1
    @Derp you do not, actually. When you create a vagrant image, you can optionally bundle a Vagrantfile with it that gets executed whenever an instance of the image is created. So you can just put the common code into the bundled Vagrantfile. – jayhendren Nov 12 '18 at 22:03