I've a drive with Fedora and Windows 7 on different partitions with dual boot.
Now, while running Fedora, I'd like to suck up the Windows partition and create an image I can run in VirtualBox - how can I do this ?
I was just trying to do nearly the exact same thing, albeit from Ubuntu. I didn't want to create an image of the entire hard drive, and it didn't seem like a good idea to me to use the physical disk with the VM. I finally found the solution:
As Matt said, you use the VBoxManage command, and that Windows might not like it. However, there's a faster way that doesn't use up as much disk space. You can use stdin as the input for the
Where $WinDevice is the device of the windows partition (such as /dev/sda2), and $Bytes is the exact number of bytes (for example, 1488581554176; you can determine this from within Windows by right-clicking on the C: drive in My Computer and hitting "Properties", it's the Capacity: line underneath the Used and Free space lines and above the pie chart).
Note that I have not tried this myself, and that I believe you might need to use /dev/sda instead of /dev/sda2, assuming you won't be writing to the drive that Windows is on. That way, you capture the partition table and bootloader.
There's a documented "internal" function that you might be interested in. You can create a "raw disk" image which basically passes all commands to the partition on your hard drive. That way, you can keep your Windows partition and attempt to boot it from VirtualBox as well.
You can create a raw image as follows:
Mind you, the chances of this working flawlessly are pretty slim. Windows is not exactly known for being adaptive to extreme changes in hardware.
You can read more about raw disks here: Chapter 9. Advanced storage configuration