Posts Tagged ‘VirtualBox’

VirtualBox – Cloning a disk image in VirtualBox

While preparing for a course I ran into a problem with cloning VirtualBox disk images…

So you have a VirtualBox disk image and need to set up similar machine.

When you need to clone a VirtualBox disk image, you cannot just copy & clone the file. If you try, you just get an error message saying for example:

ERROR: Cannot register the hard disk 'G:\Virtual_Machines\VirtualBox\Virtual_Machine\XP_Pro\Firefox\firefox.vdi' with UUID {fa9b7cd6-a1c5-4f2a-b4e5-84e64919bb36} because a hard disk 'G:\Virtual_Machines\VirtualBox\Virtual_Machine\XP_Pro\Firefox\firefox.vdi' with UUID {fa9b7cd6-a1c5-4f2a-b4e5-84e64919bb36} already exists in the media registry ('C:\Users\Baka/.VirtualBox\VirtualBox.xml')
Details: code E_INVALIDARG (0x80070057), component VirtualBox, interface IVirtualBox, callee IUnknown
Context: "OpenHardDisk(Bstr(szFilenameAbs), AccessMode_ReadWrite, false, Bstr(""), false, Bstr(""), srcDisk.asOutParam())" at line 633 of file VBoxManageDisk.cpp

It means that the UUID of the hard drive is already used in the system.

The solution is that you need to change the UUID of the disk before you can use it as a new virtual machine.

VBoxManage internalcommands setvdiuuid disk_image.vdi

Oracle VM VirtualBox Command Line Management Interface Version 3.2.10
(C) 2005-2010 Oracle Corporation
All rights reserved.

UUID changed to: 8e8c1d07-15a4-467a-92e5-e11b328f9210

Voilá!

Now you can add the disk since the UUID is changed.

Posted by pparkko on November 11th, 2010 No Comments