I have an Ubuntu 10.10 “home server” at home which I use as my home network file server, torrent box and for backup/sync with various laptops. Besides the 500 GB disk that contains the OS, I have 4x 1TB disks configured as a RAID 5 Volume with mdadm, where all my digital life is stored.Having a quad core Xeon beast with 16 GB of RAM to run this, seemed to me like an overkill and I was playing with the idea of installing Windows 7 instead of Ubuntu so that I could also push the GPU performance to its max and do some serious gaming on this machine while serving files and torrenting.
It took me quite a while to configure and tweak Ubuntu for my needs and I did not want to re-do it all again, let alone in Windows, so I decided to P2V Ubuntu (the OS disk only) and have it run under VMware Workstation 8 as a VM (WS8 supports autostart of VMs). I could then mount the software mdadm RAID volume within the VM an live happily with a both Windows 7 as the host OS and the old virtualized Ubuntu running in the background.This task proved to be more complicated than expected. I discovered that VMware Converter was not an option as the last release of Converter for Linux is quite old and simply does not work with Ubuntu 10.10 and later versions. I tried a cold P2V with the Converter CD but got a BSOD instead (my physical box is too new for that CD).So after some research and a few attempts I managed to successfully complete the P2V with a procedure that involves not one but three different virtualization products: VMware Workstation, VirtualBox and Qemu! You need to have all three of them installed on your physical machine: Qemu is available within Ubuntu’s repositories, while WS and VBox can be downloaded from their respective websites.Also an Ubuntu Live CD and – possibly, but not strictly necessary – an external and big enough external HD will be needed. Lot of time (really a lot) an patience is a must.
First you will have to create a RAW copy of your physical disk, using dd. To do this, boot into the live cd, identify your source and destination devices and run this command (replace file names and devices according to your needs):
sudo dd if=PART_PATH of=OUTPUT_PATH/ubuntu.bin
Once this lenghty process completes, reboot in Ubuntu and convert the RAW file into a VirtualBox VDI disk using this command:
VBoxManage convertdd PATH_TO_ubuntu.bin ubuntu.vdi –format VDI
qemu-img convert -O vmdk ubuntu.vdi ubuntu.vmdk