booting dd image on virtualbox

Solution 1:

I have managed to make a virtual machine by doing the following

  1. Create a Virtual Machine with a large HDD (500GB was enough for me).
  2. Install Ubuntu server 12.04 (matching my remote server).
  3. run this command ssh user@remoteserverip "dd if=/dev/sda" | dd of=/backup/ubuntu.bin it will make a copy of sda and save it to the virtual machine.
  4. After the ubuntu.bin is fully downloaded to the virtual machine, install virtualbox using the following command sudo apt-get install virtualbox.
  5. Run this command VBoxManage convertdd /backup/ubuntu.bin /backup/ubuntu.vdi --format VDI it will convert the image to a virtual hard disk.
  6. Download ubunti.vdi form the virtual machine to the host computer, the host was a windows system so I used WinSCP to download the file.
  7. Start a new virtual machine using the ubuntu.vdi file and you should be a running virtual machine of your remote server.