VirtualBox on Windows Hosts | Export and Import batch automate

batch-filebatch-processingimportvirtualboxwindows 7

VirtualBox on Windows

I am planning to deploy virtual box on around 10 computers (Vista / 7), I have setup a centos vm and exported it as an appliance with the ovf and vmdk files in the same folder.

Question Regarding VM Deployments :

Assuming VBOX is installed on the desired Machines already (latest version)
Exported Appliance is on a network share
Can I windows batch import it into vbox from the network share – what will be the vbox command/s in windows batch I would have to use to get this done?

any suggestions or if someone has done the same any best practice or things to look out for?

Kind Regards

Best Answer

What you want to do should work using the vboxmanage import command.

Use vboxmanage --dry-run to get a list of the parameters that will be used to import the appliance, these can be over ridden by following the instructions in the output of the dry run.

Import copies the appliance files to the default hard disk storage location. You may want to change this location.

vboxmanage setproperty machinefolder drive:\path

vboxmanage setproperty hdfolder drive:\path

cd \to\the\place\where\the\appliance\lives
vboxmanage import vmfile.ovf  

should import your appliance after copying it to drive:\path

The manual (such as it is) is here.

Edit:

To power on a VM use the vboxmanage startvm <vmname> command. This could be run as part of the windows startup so that the guest is running all the time.

You can pass commands to the guest from the host using the

vboxmanage guestcontrol execute ... command.

The main problem with this is that it exposes usernames and passwords you're probably better off using a statup script on the guest.