4. do vagrant repackage <boxname>
I used Vagrant package, and instead I got some really weird behavior. I packaged a box with the vagrantfile. Then I did added the box to Vagrant. Next I created a new dir, basically following what I saw here: http://docs.vagrantup.com/v1/docs/base_boxes.html. When I did the vagrant init, I got a vagrant file with the correct base box name, but everything else was just a default vagrant file - no shared folders. When I went to do a vagrant up, I get error messages saying that the paths that were specified in the original vagrantfile don't exist.
In other words, when I do a vagrant init I get a generic Vagrantfile, yet when I "up" the box the vagrantfile that was packaged with the box is the one that specifies the parameters. Certainly not the expected behavior, highly unpredictable.
Honestly, this is a mess.
Oh, and after all that, I STILL get a warning message about the virtualbox additions version. I dont even know where to start on a bug report here.
I used Vagrant package, and instead I got some really weird behavior. I packaged a box with the vagrantfile. Then I did added the box to Vagrant. Next I created a new dir, basically following what I saw here: http://docs.vagrantup.com/v1/docs/base_boxes.html. When I did the vagrant init, I got a vagrant file with the correct base box name, but everything else was just a default vagrant file - no shared folders. When I went to do a vagrant up, I get error messages saying that the paths that were specified in the original vagrantfile don't exist.You should find the Vagrantfile you added to the box with "vagrant package --vagrantfile <path> --output <baseboxpath>" in ~/.vagrant.d/boxes/<yourboxname>/include . This Vagrantfile will be automatically included by any new VM launched from that base box.
As the the different between "vagrant box repackage" and "vagrant package" (note I said "vagrant repackage" in my first message, which was an error, it is a subcommand of box, not a top level command). The repackage command takes the unpacked base box in ~/.vagrant.d/boxes/<yourboxname> and generates a compress .box file. You can think of it as the reverse of "vagrant add mybox mybox.box"The "vagrant package" command instead creates a new base box file from the current active vagrant VM.
In other words, when I do a vagrant init I get a generic Vagrantfile, yet when I "up" the box the vagrantfile that was packaged with the box is the one that specifies the parameters. Certainly not the expected behavior, highly unpredictable.The init command, as far as I'm aware, always gives you the same bare Vagrantfile. I'm not personally a fan of packaging a Vagrantfile with a base box, having just the one Vagrantfile that you can see (without digging into the base box's hidden directory) feels less magical and easier to maintain.
Honestly, this is a mess.I recognise that you are having a frustrating experience, but there is no need for that. If I were a Vagrant developer this kind of comment would certainly make me less inclined to help you.
Oh, and after all that, I STILL get a warning message about the virtualbox additions version. I dont even know where to start on a bug report here.
There already is one, and looking at the bug report it is due to be fixed in 1.0.7 ( https://github.com/mitchellh/vagrant/issues/1179 ). In the mean time there is a workaround which involves editing the unpacked vagrant box ovf file and manually changing the version number to match.
-Nick