How to create VHD disk image from a Linux live system?

Posted by Federico on Super User See other posts from Super User or by Federico
Published on 2012-04-10T21:41:15Z Indexed on 2012/04/10 23:33 UTC
Read the original article Hit count: 438

Filed under:
|
|
|
|

Once more, I have to resort at the experts here at SuperUser, as my other sources (mainly Google ;-)) didn't prove very helpful...

So basically, I would like to create a VHD image of a physical disk to be archived/accessed/maybe even mounted in a virtual machine. Now, there are dozens of articles and tutorials on how to do that on the web, but none that meets exactly the conditions I would like to achieve:

  • I would like the destination file to be a VHD image, as Windows 7 can mount it natively, even over the network and many other programs can use it (VirtualBox, ...)
  • The disk I'm trying to image contains a Windows XP install, so in theory, I could use the disk2vhd utility, but I would like to find a solution that doesn't require booting that Windows XP install (ie keep the disk read-only)
  • Thus I was searching for a solution involving some sort of live system (running from a USB stic or the network)

However, all the solutions that I've came across either make use of disk2vhd or use the dd command under linux, which does a complete copy of the disk (ie even empty blocks) and does not output a VHD file. Is there a tool/program under Linux that can directly create a VHD file? Or is is possible to convert a raw disk image created using dd to a VHD file, without allocating space for the empty blocks? How would you proceed?

As always, any advice or comment is highly appreciated!!

© Super User or respective owner

Related posts about linux

Related posts about vhd