How to transfer some files when creating a VirtualBox with Veewee

184 views Asked by At

I'm building a virtual box with Veewee and I want to have a script that calls another helper script on the newly created box.

The only way I know is to provide the main script and the helper script in the postinstall-files section of the definition.rb, like this: :postinstall_files => [ "main.sh","helper.sh"]

My problem is that Veewee is trying to execute all the scripts, including the helper script (which I don't want).

So I'm interested if there is another way of transffering my helper.sh script on the VM, in order to be called from the main.sh script.

1

There are 1 answers

0
Lukasz Wozniak On

You can use veewee build hooks like this:

Veewee::Definition.declare({
  :hooks => {
      :before_postinstall => Proc.new { definition.box.scp('/tmp/helper.sh', '/home/veewee/helper.sh') }
  }
})