Ticket #10096 (closed defect: obsolete)

Opened 6 years ago

Last modified 22 months ago

VBoxManage clonevm adds cloned disk to media manager when not requested

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

Description (last modified by aeichner) (diff)

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
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
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

comment:1 Changed 6 years ago by ken_yap

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 Changed 5 years ago by ack_steady

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
    # 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"

comment:3 Changed 5 years ago by juancarlos

After dealing with same issue, I posted a workaround here

comment:4 Changed 22 months ago by aeichner

  • Status changed from new to closed
  • Resolution set to obsolete
  • Description modified (diff)

Please reopen if still relevant with a recent VirtualBox release.

Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use