Vagrant Package Include No Files

I cannot figure out how to get the included files from a packaged stray box.

Package created using

$ vagrant package --include mydirectory/ --output mypackage.box

Then a window is added

$ vagrant box add mypackage.box --name myPackageWithFiles

Then init and vagrant up

$ vagrant init myPackageWithFiles
$ vagrant up

But when I ssh into the newly created stray box, there is no "mydirectory /"

I see this on my local machine:

$ ls ~/.vagrant.d/boxes/myPackageWithFiles/0/virtualbox/include/
mydirectory/

How do I get this directory in my stray field? Should I add something to Vagrantfile?

+4
source share
2 answers

Try adding the following to your Vagrant file: end-line:

config.vm.synced_folder "~/.vagrant.d/boxes/myPackageWithFiles/0/virtualbox/include/mydirectory/", "~/mydirectory"

The first parameter is local, and the second is the path to the remote folder.


There are also many other parameters that you can read here here .

0

--base vagrant package. . VirtualBox, --base - VirtualBox, mybox_default_1470762777375_10784. - VirtualBox Manager.

.

0

All Articles