Converting a VMWare image to a RAW (ISO) Image

If you configured VMWare to use 2gb filesystem chunks, then you cannot just convert the vm.vmdk file to a raw image, you instead need to convert each chunk, then merge them together.

qemu-img  convert -f vmdk /home/e/vm/vm-s001.vmdk -O raw /tmp/vm-001.raw qemu-img  convert -f vmdk /home/e/vm/vm-s002.vmdk -O raw /tmp/vm-002.raw qemu-img  convert -f vmdk /home/e/vm/vm-s003.vmdk -O raw /tmp/vm-003.raw qemu-img  convert -f vmdk /home/e/vm/vm-s004.vmdk -O raw /tmp/vm-004.raw qemu-img  convert -f vmdk /home/e/vm/vm-s005.vmdk -O raw /tmp/vm-005.raw

 then,

cat vm-002.raw >> vm-001.raw cat vm-003.raw >> vm-001.raw cat vm-004.raw >> vm-001.raw cat vm-005.raw >> vm-001.raw

If you were successful, 

fdisk -l /tmp/vm-001.raw
 should produce a partition table
eon:/tmp# fdisk -l vm-001.raw You must set cylinders. You can do this from the extra functions menu. Disk vm-001.raw: 0 MB, 0 bytes 255 heads, 63 sectors/track, 0 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

     Device Boot      Start         End      Blocks   Id  System vm-001.raw1   *           1         997     8008371   83  Linux vm-001.raw2             998        1044      377527+   5  Extended Partition 2 has different physical/logical endings:      phys=(1023, 254, 63) logical=(1043, 254, 63) vm-001.raw5             998        1044      377496   82  Linux swap / Solaris


  

Related posts:

  1. Java + Firefox + Debian
  2. VMWare Workarounds

Leave a Reply

Your email address will not be published. Required fields are marked *

*