Maximum PC published a great article on how to preserver your hard drive to a virtual image using a new tool from Microsoft called Disk2VHD

This tool allows you to take any computer running Windows XP or newer on the desktop or Windows 2003 or newer on the server and create a bootable image file you can run virtually within a virtual PC environment.  This is very handy if you are upgrading your computer from Windows XP to Windows 7 since there is no direct upgrade path.  You create an image of your Windows XP computer first then install Windows 7.  After that you can run your old computer as a virtual computer with all settings and programs in tact!

The one caveat is that you must have 127GB of data or less on your boot partition for this process to work correctly.  What MaximumPC does not tell you is that even if you have less than 127GB of data, if the partition or hard drive was originally larger than 127GB you will have to use DiskPart and VHDResizer to get it working correctly.  The instructions for this can be found here.