Finally after so much searching, I have managed to create this article where I explain the whole process to follow to get a successful cloning to a VDI image file and I share it with you.
To start cloning your disk/partition into a new VDI virtual disk file, you must have the latest version of VirtualBox installed. You can download it from here: https://www.virtualbox.org/wiki/Downloads
IMPORTANT:NOTE: The whole process has been tested and I can confirm that it works correctly.
- Before proceeding, you must unmount the partition to be copied to the VDI virtual disk file.
- In case of being a disk, you must create a LiveCD or LiveUSB with ubuntu to follow the procedures.
- In the steps to follow, I will only talk about partition but they can be applied to convert a partition or disk.
- You must replace sdx1 with the letter corresponding to your unit.
- In case you want to clone a bootable disk, in origin you must enter the location of the disk (this includes the MBR and all the partitions)..
- Determine the size of the partition in bytes:
Take note of the number that appears in the size column, for example: 138412032B
Code: Select all
sudo parted /dev/sdx1 unit B p
- Clone the partition to VDI virtual disk file:
Consider replacing the word BYTES with the number you noted in the previous step.
Code: Select all
sudo dd if=/dev/sdx1 | VBoxManage convertfromraw stdin /Path_to_destination/NameImage.vdi BYTES --format VDI
- Done.