Thursday, May 5, 2016

Move your Virtual Box machine and files location


If you need to move your vbox , vdi, and vmdk files from one location to another you may encounter that in your vbox file the location of your disks is hard coded.

After you move the files, if you try to run your VM you may get the errors:

Failed to open the hard disk <FilePath> or Cannot register the hard disk <FilePath> {GUID} because a hard disk <DifferentFilePath> with UUID {GUID} already exists.

To solve that do the following:

a) Execute vboxmanage command specifying the full path name of each one of your disks, for example:

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" internalcommands sethduuid E:\VM\SE-disk1.vmdk

b) Edit the vbox file and update the lines where your hard disk is specified using the output of the previous command, for example:


 <HardDisks>
        <HardDisk uuid="{d2c62e46-e10e-4784-9b8e-61ca357f28b5}" location="SE-disk1.vmdk" format="VMDK" type="Normal"/>
        <HardDisk uuid="{0f563dcb-5f2c-491f-9a02-1015514778ae}" location="SE-disk2.vmdk" format="VMDK" type="Normal"/>
</HardDisks>

<AttachedDevice type="HardDisk" port="0" device="0">
          <Image uuid="{d2c62e46-e10e-4784-9b8e-61ca357f28b5}"/>
</AttachedDevice>
<AttachedDevice type="HardDisk" port="0" device="1">
          <Image uuid="{0f563dcb-5f2c-491f-9a02-1015514778ae}"/>
</AttachedDevice>


c) Remove your VM from the Manager and add it again.

That's it, you are done!!!.



No comments:

Post a Comment