A script to create linux virtual machine and run a script there

automated-installvirtualbox

I'd like to get a script working that would automate the following

  1. create a virtual machine
  2. install a linux distro
  3. run a command inside the distro
  4. shutdown and remove the virtual machine

To create VM, I can use vbox manage. however I have no idea if it is even possible to automate installing linux (for example from ubuntu.iso) and inside that installation run another script.

let me know your thoughts.

Best Answer

http://vagrantup.com/ will be able to help you automate the install of the distro.