Page 1 of 1

How to make a linked clone using VBoxManage?

Posted: 17. Mar 2014, 20:23
by morspin
I want to make a couple of linked clones of each imported, created VM, but VBoxManage complains that I can't make a linked clone of a snapshotless VM. I want to clone the VM before I run it the first time, and don't need a snapshot before the first launch.

I have a shell script like this:

Code: Select all

import --vsys 0 --ostype Ubuntu_64 $ovfFile
vmname=xxxx
newName=${vname}-clone-1
clonevm $vmname --options link --name $newName --register
gives this error message:

Code: Select all

VBoxManage: error: Linked clone can only be created from a snapshot
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component Machine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "CloneTo(trgMachine, mode, ComSafeArrayAsInParam(options), progress.asOutParam())" at line 482 of file VBoxManageMisc.cpp
That message makes sense, because the docs for clonevm state that a linked clone can only be made
from a snapshot. But when I use the UI I can make a linked clone of a freshly imported appliance. What
else do I have to do from the command-line?

Is there a way to launch VirtualBox from the command-line so I can see the underlying commands UI actions trigger? I tried --debug-command-line but that had no effect.

- Eric

Re: How to make a linked clone using VBoxManage?

Posted: 18. Mar 2014, 09:17
by noteirak
Moved to Using Virtualbox.

Re: How to make a linked clone using VBoxManage?

Posted: 18. Mar 2014, 13:58
by mpack
morspin wrote:But when I use the UI I can make a linked clone of a freshly imported appliance. What
else do I have to do from the command-line?
But, if you check the results afterwards you'll find that both the original and clone VMs are now using difference images derived from the base VDI.

So, I guess you have to snapshot the original VM first (VBoxManage snapshot).