How do I start Virtualbox from the command line and start a Ruby script on the guest and after the script is done close the guest? What could be easiest way to do this?
You can start the VM with VBoxManage:
After the VM has booted you can run a program if you have guest editions installed:
Finally, when the program has finished executing you can close the VM with the command:
Alternatively, you can shutdown the machine with a command at the end of the Ruby Script