Converting VDMK to VDI and Registering the Converted VM

Once the import is done you will be left with a .vdmk file if you don’t care if you have a .vdmk file then you can skip the rest of this as you are ready to go.
For the rest of us it is time to get the .vdi file and have it work. First the conversion Make sure that you are in the Virtual Machine Directory or you give an absolute path when running the command.
$ VBoxManage clonehd vmName.vmdk vmName.vdi –format VDI

When it is complete you will see a line like this. (copy what is highlighted in it will be needed next)
Clone hard disk created in format ‘VDI’. UUID: 73588bfa-49a4-45a0-8ae4-7adec7341c76

This will leave the .vmdk file and create the new .vdi file. At this point you can delete the .vmdk file if you want. The machine however will not run until we edit the <vmName.vbox file>. So open up the vmName.vbox with your favorite editor and look for this line

<HardDisk uuid=”{c2b41c6b-abc6-4c05-ae1a-7d05c3dcba6b}” location=”vmName.vmdk” format=”VMDK” type=”Normal”/>

Now we need to change a few things here first is the uuid, we need to delete everything in the brackets and put in the we copied above from the clonehd command. Next we need to change in the location the .vmdk to .vdi. The final thing to change is the format and change the VMDK to VDI. When finished it should look like the following

<HardDisk uuid=”{73588bfa-49a4-45a0-8ae4-7adec7341c76}” location=”vmName.” format=”” type=”Normal”/>

Ok there is one more line to change, so lets look for the line that says this (should be near the bottom)
<Image uuid=”{c2b41c6b-abc6-4c05-ae1a-7d05c3dcba6b}”/>

and we need to change it to this

<Image uuid=”{73588bfa-49a4-45a0-8ae4-7adec7341c76}”/>
Now we need to save the file.

Once it is saved then we need to register the VM, run this command
$ VBoxManage registervm /VMF/vmName/vmName.vbox

Start the VM now
With RDP support (recommended for first run to make sure the machine is working)
VBoxHeadless –startvm WebServer

without RDP support
$ VBoxHeadless –startvm WebServer –vrde=off &

Well that is it, you should have now imported a .OVA or a .OVF and converted the .vmdk file to a .vdi file and the machine should be running.

Taggato su: ,
Loading Facebook Comments ...

Lascia un commento