March 2009 Archives

Due to some hardware trouble with my main work machine, I'm presently working in a virtual machine on my personal computer. After a few dim trails, I found a pretty straightforward method to clone my work computer into a virtual machine image, so that I am able to work in the exact same environment I would have on my physical work computer. Here's how to do it:

  1. Clone the drive using dd (the following example assumes your drive is /dev/sda and you have an external drive mounted at /media/removable:
  2. Use qemu-img to convert the raw bits of the drive to an image in the appropriate format for the virtual machine monitor you want to use (QEMU or VMWare):
  3. Create a new virtual machine that uses this drive image, using the interface for your preferred virtual machine monitor.

I was able to image and convert a 100 gb drive in around six hours. My drive was an LVM volume and the home partition was encrypted with LUKS; I was delighted to see that qemu-img handled these oddball features of my drive flawlessly. (I can't think of a technical reason why these wouldn't be supported, but I'm nonetheless inclined to be pleasantly surprised when things work as they should out of the box.)

About the author

I'm Will Benton and I'll be posting some short technical articles related to my work -- specifically, programming languages, broadly construed, and high-throughput, high-performance, and distributed computing.

About this Archive

This page is an archive of entries from March 2009 listed from newest to oldest.

June 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Categories

Pages

Powered by Movable Type 4.25