Search code examples
vagrantvirtualboxpuppetvirtualization

Built-in Port forwarding > Vagrant package can't find Vagrantfile.pkg


Following the documentation for vagrant vbox packaging here. I am attempting to package a virtual box with port forwarding auto-configured by including an auxiliary vagrant file Vagrantfile.pkg thusly:

vagrant package dev --output mybox.box --vagrantfile Vagrantfile.pkg

And I get the following error:

Package include file doesn't exist: Vagrantfile.pkg

I have tried putting this in the project root (where the main vagrantfile is), in the VM shared folder, and a few other places, all with the same error.

My host environment is Windows 7, which I suspect is the source of this issue.

Has anyone succeeded at packaging a vagrant file for this purpose?

Here is the content of Vagrantfile.pkg for reference, not that it should affect this bug.

Vagrant::Config.run do |config|
  config.vm.host_name = 'dev.local'
  config.vm.network :hostonly, '192.168.33.35'
  config.vm.forward_port 80, 8080
end

Solution

  • On a guess, the following appears to have worked:

    vagrant package dev --output mybox.box --vagrantfile ../Vagrantfile.pkg