Mircea
Mircea

Reputation: 131

How to transfer some files when creating a VirtualBox with Veewee

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.

Upvotes: 2

Views: 183

Answers (1)

Lukasz Wozniak
Lukasz Wozniak

Reputation: 91

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') }
  }
})

Upvotes: 1

Related Questions