Cloning VM with VBoxManage command - files OK, but no new VM

2

My goal is to automate VM backup tasks. I recently discovered the use of on line command Vboxmanage and got some nice results.

However I'm puzzled with the command:

VBoxManage  clonevm "name of the vm"

It works just fine creating a new folder with a VDI copy, but not a new VM by itself.

There's no new VM in the GUI and

VBoxManage list vms

does not list more VMs than before. Also, the .Virtualbox/VirtualBox.xml remains untouched.

My final goal is a script that will:

  1. Stop a running VM,
  2. Clone it fully,
  3. Copy it to another media (external USB drive), and
  4. Restart the initial VM

I'd like the process to do it again each night and delete the older VM on maybe a 3 day cycle.

user1011212

Posted 2017-05-11T13:22:54.127

Reputation: 21

Answers

3

Use --register option in the clonevm command. That registers VM in VirtualBox XML file. With --basefolder option you can select the folder where the new virtual machine configuration should be saved in. And you can make a scheduled task in Windows host to clone VM automatically.

See more:: Clone VM with GUI

Clone VM with Command

Biswapriyo

Posted 2017-05-11T13:22:54.127

Reputation: 6 640