Copy Amazon EC2 image to a local Ubuntu machine?

Solution 1:

You should be able to do that. I haven't kept up with Eucalyptus so I don't know the exact steps but it would be something like this:

  1. Assuming you have used an EBS backed instance you would halt the instance when you are ready to copy it. Make sure you don't terminate it or you might have your EBS volume deleted. You could also take a snapshot of the volume instead.

  2. Boot another instance and attach the volume for the first instance to it.

  3. Copy the contents of the volume. Something like dd if=/dev/sdh of=ec2instance.img

  4. Use the Eucalyptus instructions for creating your own image. Skip the steps about creating the image and instead use the one from EC2.

YMMV due to device mappings but it should be something you can fix by mounting the raw image via a loopback device and editing the contents of your /etc/fstab, etc.