how to create linked clones via VBoxManage ?

This is for discussing general topics about how to use VirtualBox.
Post Reply
isrc
Posts: 13
Joined: 19. Nov 2008, 14:24

how to create linked clones via VBoxManage ?

Post by isrc »

Hi,
As i don't quiet get what is this new linked clone feature, i tryed to create one via VBoxManage.
Sadly, i end up getting the following error and i don't know what i'm doing wrong :( Would really appreciate any help please :-)

By the way, the VM i'm trying to clone is attached to a "multiattach disk"

Code: Select all

$ VBoxManage showvminfo vm-srv-drupal
Name:            vm-srv-drupal
Guest OS:        Red Hat
UUID:            e21d5840-ed20-4e99-a4fc-1cec94594b59
Config file:     /home/tech/VirtualBox VMs/vm-srv-drupal/vm-srv-drupal.vbox
Snapshot folder: /home/tech/VirtualBox VMs/vm-srv-drupal/Snapshots
Log folder:      /home/tech/VirtualBox VMs/vm-srv-drupal/Logs
Hardware UUID:   e21d5840-ed20-4e99-a4fc-1cec94594b59
Memory size:     512MB
Page Fusion:     off
VRAM size:       12MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  1
Synthetic Cpu:   off
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): HardDisk
Boot Device (2): DVD
Boot Device (3): Not Assigned
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
PAE:             on
Time offset:     0 ms
RTC:             UTC
Hardw. virt.ext: on
Hardw. virt.ext exclusive: on
Nested Paging:   on
Large Pages:     off
VT-x VPID:       on
State:           powered off (since 2011-07-26T10:47:06.000000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address: 
Teleporter Password: 
Storage Controller Name (0):            Contrôleur IDE
Storage Controller Type (0):            PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  2
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
Storage Controller Name (1):            Contrôleur SATA
Storage Controller Type (1):            IntelAhci
Storage Controller Instance Number (1): 0
Storage Controller Max Port Count (1):  30
Storage Controller Port Count (1):      1
Storage Controller Bootable (1):        on
Contrôleur IDE (1, 0): Empty
Contrôleur SATA (0, 0): /home/tech/VirtualBox VMs/vm-srv-drupal/Snapshots/{689923cc-46aa-4a48-b9a2-ee5820e278a9}.vdi (UUID: 689923cc-46aa-4a48-b9a2-ee5820e278a9)
NIC 1:           MAC: 080027445D9F, Attachment: Bridged Interface 'eth0', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny
NIC 2:           disabled
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: PS/2 Mouse
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
Audio:           enabled (Driver: PulseAudio, Controller: AC97)
Clipboard Mode:  Bidirectional
VRDE:            disabled
USB:             enabled

USB Device Filters:

<none>

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Shared folders:  <none>

VRDE Connection:    not active
Clients so far:     0

Guest:

Configured memory balloon size:      0 MB
OS type:                             RedHat
Additions run level:                 0

Guest Facilities:

No active facilities.

Snapshots:

   Name: clone-test (UUID: a2b8a453-f000-46ee-bb4b-073c530c1cd3) *


$ VBoxManage clonevm vm-srv-drupal --options link --name vm-linked-clone 
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
Context: "CloneTo(trgMachine, mode, ComSafeArrayAsInParam(options), progress.asOutParam())" at line 444 of file VBoxManageMisc.cpp


I'm running Virtualbox-4.1.0 on Fedora 14 !
Thanks !
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 create linked clones via VBoxManage ?

Post by mpack »

As I (only vaguely) understand it, a linked cloned is one which uses a differenced child VDI stored in the clone VM, which is connected/decended from a snapshot tree stored in a different VM. However, since I would not use snapshots if you paid me, that kind of limits my exposure to the feature. I am not sure what the advantage is supposed to be, compared to creating another snapshot branch in the original VM.
ch.eick
Posts: 19
Joined: 12. Apr 2011, 09:15
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP; Win7

Re: how to create linked clones via VBoxManage ?

Post by ch.eick »

Hi isrc,

as you can see in your error messages, you first have to create a snapshot and after that you can
create a clone out of that snapshot.
One advantage of this cloning version is, that you will save lots of storage. The linked clone will
only include changed blocks, if you install additional software or patches. One Example:
your basic installation has 15GB, after taking a snapshot and create a linked clone, your clone may have
a size of 150MB and will than start increasing. If you will have multiple clones of one snapshot, this will
save lots of storage and you are able to switch back to a clean installation (you basic image).

regards
Chris
isrc
Posts: 13
Joined: 19. Nov 2008, 14:24

Re: how to create linked clones via VBoxManage ?

Post by isrc »

Hi guys,
Thanks a lot for your answers so far :-) I'll start from scratch with a VM with a "standard" disk (instead of the "multiattach" disk i was using.
I was creating linked clone so far thanks to the "immutable" disk type so far (and then with the "multiattach" type recently) so i'm curious to know how this linked clone feature compare to those method :-)

@ch.eick: I think that i've created a snapshot. And according to the result of VBoxManage showvminfo posted earlier, looks like the snapshot is known by vbox

Thanks !
daxm
Posts: 1
Joined: 17. Aug 2011, 19:03
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly Ubuntu 11.04 Desktop/Server

Re: how to create linked clones via VBoxManage ?

Post by daxm »

Following http://galvanite.blogspot.com/2011/07/l ... mment-form I was able to create linked clones. (I've also done it with the GUI now that it is integrated there too.) I prefer the former over the latter though.
isrc
Posts: 13
Joined: 19. Nov 2008, 14:24

Re: how to create linked clones via VBoxManage ?

Post by isrc »

daxm wrote:Following http://galvanite.blogspot.com/2011/07/l ... mment-form I was able to create linked clones. (I've also done it with the GUI now that it is integrated there too.) I prefer the former over the latter though.
Ah thanks daxm ! This is exactly what i was doing so far as i didn't really get how to use the "--options link" settings :)
Thanks for the feedback on the GUI settings :-) ! I haven't yet upgraded to 4.1.2
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 create linked clones via VBoxManage ?

Post by mpack »

One warning about that blog: the bit about being able to apply security updates to the parent and have it automatically apply to all the children... sounds like fantasy to me. I don't see how that could possibly work unless each linked clone is reset to the parent state, losing all individual changes. However in a scenario in which each clone is considered disposable, let's say: deleted at the days end or at the end of a training course, then I can see how this could be a useful feature.
isrc
Posts: 13
Joined: 19. Nov 2008, 14:24

Re: how to create linked clones via VBoxManage ?

Post by isrc »

mpack wrote:One warning about that blog: the bit about being able to apply security updates to the parent and have it automatically apply to all the children... sounds like fantasy to me. I don't see how that could possibly work unless each linked clone is reset to the parent state, losing all individual changes. However in a scenario in which each clone is considered disposable, let's say: deleted at the days end or at the end of a training course, then I can see how this could be a useful feature.
Fair warning imho !
In my use case, i use those "linked" VM as disposable VM for lab training, so this is a killer feature !
TechGeek
Posts: 33
Joined: 22. Sep 2009, 01:25
Primary OS: Fedora other
VBox Version: OSE Fedora
Guest OSses: linux

Re: how to create linked clones via VBoxManage ?

Post by TechGeek »

mpack is correct. You shouldn't change the parent of a linked clone. I haven't tried yet so I don't know if it will actually let you, but its a very easy way to end up with a corrupted system. The main use for linked clones over snapshots is multi user systems where you share common parents as templates. This allows users to create linked clones that they own, while only having read access to the parents. This is the way VMware's Lab Manager works. It is also very efficient with disk space and deploying new virtual machines(no copying of disk files).
Post Reply