How to make a linked clone using VBoxManage?

This is for discussing general topics about how to use VirtualBox.
Post Reply
morspin
Posts: 1
Joined: 16. Mar 2014, 23:40

How to make a linked clone using VBoxManage?

Post 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
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: How to make a linked clone using VBoxManage?

Post by noteirak »

Moved to Using Virtualbox.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: How to make a linked clone using VBoxManage?

Post 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).
Post Reply