0
votes

I have created a windows batch file that can create a virtual machine on virtualbox with a specific configuration to suit my needs (using vboxmanage). However, you still have to manually start up the virtual machine and answer the virtual OS's prompts (language, hostname) to complete the virtual OS installation. I would like to have my batch file do this for me. In addition, I would like my batch file to install Guest Additions as well. I've read that I could mount the Guest Additions iso file to my virtual machine somehow, but I wouldn't know what to do after that.

I doubt that this can be done since the installation is done on the virtual OS's side and not the host/virtualbox's. Just want to make sure.

1
You can mount the DVD automatically, but I never found a way to auto-run it. VBoxManage storageattach %VNAME% --storagectl %DISK_CONTROLLER_1% --port 1 --device 0 --type dvddrive --medium %DVDISO_GUESTADDITIONS% Have you heard of "Vagrant"? It is a system for managing the creation of VMs and will do all sorts of setup stuff for you ... much better than writing batch files :-)joeking
I haven't heard of Vagrant, but I'll be sure to check it out. Thanks for your help! :)marcd6

1 Answers

0
votes

It is much easier to do it using both Vagrant and Ansible. Checkout this repository for a shopping system and see how they did it: https://github.com/shopwareLabs/shopware-vagrant

After you test it then play with the ansible roles to set up the achine the way you want and then you can create a bach file that does run the command vagrant up