Page 1 of 1

Cloning encrypted MV

Posted: 27. Mar 2020, 12:49
by JoseManuelLasJim
These are my steps:

VBoxManage createvm --name "Ubuntu1804enc" –register

VBoxManage modifyvm "Ubuntu1804enc" --memory 2048 --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 "eth2" --cableconnected1 on

VBoxManage storagectl "Ubuntu1804enc" --name "IDE Controller" --add ide

VBoxManage createhd --filename "C:\Users\jmlascasas\VirtualBox VMs\Ubuntu1804enc\Ubuntu1804encdisk.vdi" --size 20000


Everything good , now comes the command that makes the error, The uuid is copied from the .vbox of the VM i want to clone => <HardDisk uuid="{93d856a5-c7cc-4795-b392-7de782e0acf8}"

VBoxManage storageattach "Ubuntu1804enc" --storagectl "IDE Controller" --port 0 --device 0 --type hdd --medium "C:\Users\jmlascasas\VirtualBox VMs\Ubuntu1804enc\Ubuntu1804encdisk.vdi" --setuuid 93d856a5-c7cc-4795-b392-7de782e0acf8

And this is the error:

VBoxManage.exe: error: Medium 'C:\Users\jmlascasas\VirtualBox VMs\Ubuntu1804enc\Ubuntu1804encdisk.vdi' is not accessible. Accessibility check was not yet performed
VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MediumWrap, interface IMedium, callee IUnknown
VBoxManage.exe: error: Context: "SetIds(fSetNewUuid, bstrNewUuid.raw(), fSetNewParentUuid, bstrNewParentUuid.raw())" at line 694 of file VBoxManageStorageController.cpp
VBoxManage.exe: error: Failed to set the medium/parent medium UUID

I found no valid info, and yet not solved the problem, would aprecciate help

Thankyou

Re: Cloning encrypted MV

Posted: 20. Jan 2021, 13:39
by scottgus1
Here's what I gather:
You're setting up a VM via command line: make a disk file, attach the disk file to a guest, and try to set the UUID of the attached disk file to a UUID that came from another .vbox file, in the hope that it will clone an existing disk.

First, I believe that just changing a new disk's UUID to match an existing disk's UUID will not clone the existing disk to the new one.

Second, if that UUID from another .vbox is for an object that already exists in Virtualbox (such as a disk file that Virtual Media Manager reports, even if the actual file doesn't exist anymore) then you can't register two objects with the same UUID.

If you want to clone a disk file, I think you should run a command to directly clone the disk file, instead of making a new disk file and changing the UUID: "VBoxManage clonemedium".

If the above does not answer within the scope of your project, then we'd need to know what the project is and what you're starting with. See "XY problem".