Thanks José

here's how I'm doing it:

Vagrant file:
# -*- mode: ruby -*-
# vi: set ft=ruby :
--------------------
Vagrant.configure(2) do |config|
  config.vm.provision :shell, :path => File.expand_path("../bootstrap.sh", 
__FILE__)
end
--------------------

and for my bootstrap.sh (I'm using archlinux)
--------------------
#!/usr/bin/env bash

pacman -Syy
pacman -S --noconfirm pacman
--------------------(have some extra stuff)

$ vagrant package --base BASE_VM --output BASE_VM.box 
--include=bootstrap.sh --vagrantfile VagrantFile

when I import/init the VM, those files are created under 
~/.vagrant.d/boxes/BASE_VM/0/virtualbox/include/

and vagrant up --provision works as expected (at least for me)

Hope that helps
Mauricio


On Friday, May 30, 2014 12:58:46 AM UTC-7, José Pedro Correia wrote:
>
> Hi Mauricio,
>
> The inlining "solution" worked for me, so I just stuck with that. Haven't 
> looked into it ever since.
>
> On Thursday, May 29, 2014 11:30:17 PM UTC+2, Mauricio O wrote:
>>
>> José Pedro Correia <zepedro.correia@...> writes: 
>>
>> > 
>> > 
>> > Hi all, 
>> > I have a similar problem. I am trying to package a base box 
>>  to be reused by other environments. My 
>> Vagrantfile contains the following line: 
>> > 
>> > 
>> >   > config.vm.provision :shell, :path => 'initialize-machine.sh' 
>> > 
>> > I package the box using the following command: 
>> > 
>> >   > vagrant package --output=somewhere/base.box \ 
>> --vagrantfile Vagrantfile --include initialize-machine.sh 
>> > 
>> > If I do: 
>> > 
>> >   > mkdir /tmp/box 
>> >   > cd /tmp/box 
>> >   > vagrant init base somewhere/base.box 
>> >   > vagrant up 
>> > 
>> > I get the following output: 
>> > 
>> >   > There are errors in the configuration of this machine. 
>> Please fix the following errors and try 
>> again: 
>> >   > shell provisioner: 
>> > 
>> >   > * `path` for shell provisioner does not exist on the 
>>  host system: /tmp/box/initialize- 
>> machine.sh 
>> > 
>> > So, my Vagrantfile is being processed, but the included 
>>  file is not properly handled. 
>> > 
>> > I'm running Vagrant 1.2.7 on Scientific Linux 6.1 
>> > 
>> > I'm going to solve this problem by just inlining the shell script, 
>> but I would expect this to have 
>> worked... 
>> > On Friday, August 2, 2013 3:25:59 AM UTC+2, Philip Rodrigues 
>> wrote:No one else has this issue ?  
>> > 
>> > 
>> > 
>> > 
>> > 
>>
>>
>> I am running into the same issue 
>>
>> using Vagrant 1.5.4 on OSX 
>>
>> did you have any luck making it work as expected? 
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to