3

I run a Windows XP VM on an Ubuntu host machine version 14.04. I cloned 5 times the main VM. I am running a special software on the first VM. The software will damage the VM one day or an other. So That is why I automatically start one of the remaining 4 VM.

As the remaining VMs will be harmed by time, I wonder how could I generate a bash script on the host machine that will allow me to automatically clone a safe VM ?

2
  • 1
    vboxmanage clonevm vm1 --name vm2 could be use to clone vm1 to vm2 - just needs something to check which vms are now harmed etc.
    – Wilf
    Aug 12, 2014 at 9:09
  • @Wilf Is really vboxmanage clonevm vm1 --name vm2 all what I need ? Is it this simple ? Thank you. I do not need to check which VM is safe because I will let one VM not running at all and I will clone it once each 10 days.
    – user284234
    Aug 12, 2014 at 9:13

1 Answer 1

4

To just clone the VM vm1 (where vm1 is the name of the VM) to vm2, something like this will do:

vboxmanage clonevm vm1 --name vm2

For more information, run vboxmanage --help - clonevm can take varying options:

  clonevm                   <uuid|vmname>
                            [--snapshot <uuid>|<name>]
                            [--mode machine|machineandchildren|all]
                            [--options link|keepallmacs|keepnatmacs|
                                       keepdisknames]
                            [--name <name>]
                            [--groups <group>, ...]
                            [--basefolder <basefolder>]
                            [--uuid <uuid>]
                            [--register]

This could be done automatically in a script (e.g. checking mod/access times, assigned name based on date, gvfs variable, etc)

You must log in to answer this question.