VirtualBox

Opened 12 years ago

Closed 8 years ago

#10096 closed defect (obsolete)

VBoxManage clonevm adds cloned disk to media manager when not requested

Reported by: Powelly Owned by:
Component: VM control Version: VirtualBox 4.1.8
Keywords: Cc:
Guest type: other Host type: Linux

Description (last modified by aeichner)

The VBoxManage clonevm command adds the cloned harddisk to the media manager even when the "--register" option is not used.

This causes clonevm to fail when used more than once.

For example:

~> VBoxManage clonevm Mercury --mode all --basefolder "/mnt/Bronze Backup/Virtual Machines" --name Mercury
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Machine has been successfully cloned as "Mercury"

~> rm -r /mnt/Bronze\ Backup/Virtual\ Machines/Mercury/

~> VBoxManage clonevm Mercury --mode all --basefolder "/mnt/Bronze Backup/Virtual Machines" --name Mercury
0%...10%...20%...30%...40%...50%...60%...70%...80%...
Progress state: NS_ERROR_INVALID_ARG
VBoxManage: error: Cannot register the hard disk '/mnt/Bronze Backup/Virtual Machines/Mercury/Mercury.vdi' {da9523a4-5d83-4cfe-bc80-10344c6d424f} because a
hard disk '/mnt/Bronze Backup/Virtual Machines/Mercury/Mercury.vdi' with UUID {cf6bdde6-3425-47c0-b875-329ddb4cfe67} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component Machine, interface IMachine, callee

Change History (4)

comment:1 by ken_yap, 12 years ago

I'm affected by this bug too, it's still in 4.1.20. Surely it can't be that hard to fix? Every time I clone a VM I have to unregister the media manually. Is there a way to unregister the media from VBoxManage? I couldn't find it.

comment:2 by ack_steady, 10 years ago

Bug still exists in 4.2.16.

Here's a bash snippet I use to remove the clone VHD after cloning the VM:

# $vm_uuid is for the VM that was cloned
backup_hdd_uuids=`vboxmanage list hdds | grep -B3 "$vm_uuid Clone" | grep '^UUID' | cut -d':' -f2 | tr -d ' '`
for hdd_uuid in $backup_hdd_uuids
do
    # Uncomment the following line to make this script work.
    # NOTE that this script will not work properly in certain cases - one I'm aware of is if the VM has more than 3 HDDs.
    # vboxmanage closemedium disk $hdd_uuid
    echo "Removed $hdd_uuid"
done

comment:3 by juancarlos, 10 years ago

After dealing with same issue, I posted a workaround here

https://forums.virtualbox.org/viewtopic.php?f=1&t=58463

comment:4 by aeichner, 8 years ago

Description: modified (diff)
Resolution: obsolete
Status: newclosed

Please reopen if still relevant with a recent VirtualBox release.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use