Custom Search

Wednesday, May 22, 2013

How to use qemu-img to convert disk raw vmdk

* I am using Ubuntu 12.04 LTS
* I Installed qemu-1.2.0 from tarball
#sudo apt-get install libglib2.0-dev
#wget http://wiki.qemu.org/download/qemu-1.2.0.tar.bz2
#tar xfj qemu-1.2.0.tar.bz2
#cd qemu-1.2.0
#./configure && make qemu-img
http://serverfault.com/questions/429478/conversion-of-a-vmdk-image-with-qemu-img-failed-with-error-while-reading-sector


1)
How to Convert vmdk disk to raw disk

============================
#qemu-img convert -O raw ubuntu-12.04.vmdk ubuntu-12.04.xm

2)
How to Convert vmdk disk to qcow2 disk
==============================

#qemu-img convert -O qcow2 ubuntu-12.04.vmdk ubuntu-12.04.xm

3)
How to Convert raw disk to vmdk disk
============================

#qemu-img convert -O vmdk ubuntu-12.04.xm buntu-12.04.vmdk

4)
How to Convert qcow2 disk to vmdk disk
==============================

#qemu-img convert -O vmdk ubuntu-12.04.xm buntu-12.04.vmdk
  

Supported image file formats:
====================

raw
   Raw disk image format (default). This format has the advantage of
   being simple and easily exportable to all other emulators. If your
   file system supports holes (for example in ext2 or ext3 on Linux or
   NTFS on Windows), then only the written sectors will reserve space.
   Use "qemu-img info" to know the real size used by the image or "ls
   -ls" on Unix/Linux.

qcow2:
   QEMU image format, the most versatile format. Use it to have
   smaller images (useful if your filesystem does not supports holes,
   for example on Windows), optional AES encryption, zlib based
   compression and support of multiple VM snapshots.

   Supported options:

   "backing_file"
       File name of a base image (see create subcommand)

   "backing_fmt"
       Image format of the base image

   "encryption"
       If this option is set to "on", the image is encrypted.

       Encryption uses the AES format which is very secure (128 bit
       keys). Use a long password (16 characters) to get maximum
       protection.

   "cluster_size"
       Changes the qcow2 cluster size (must be between 512 and 2M).
       Smaller cluster sizes can improve the image file size whereas
       larger cluster sizes generally provide better performance.

   "preallocation"
       Preallocation mode (allowed values: off, metadata). An image
       with preallocated metadata is initially larger but can improve
       performance when the image needs to grow.

qcow:
   Old QEMU image format. Left for compatibility.

   Supported options:

   "backing_file"
       File name of a base image (see create subcommand)

   "encryption"
       If this option is set to "on", the image is encrypted.

cow:
  User Mode Linux Copy On Write image format. Used to be the only
   growable image format in QEMU. It is supported only for
   compatibility with previous versions. It does not work on win32.

vdi: 
  VirtualBox 1.1 compatible image format.

vmdk:
   VMware 3 and 4 compatible image format.

   Supported options:

   "backing_fmt"
       Image format of the base image

   "compat6"
       Create a VMDK version 6 image (instead of version 4)

vpc:
 VirtualPC compatible image format (VHD).

cloop:
   Linux Compressed Loop image, useful only to reuse directly
   compressed CD-ROM images present for example in the Knoppix CD-
   ROMs.





No comments:

Post a Comment