[kwlug-disc] Networking on libvirt vs. VirtualBox

Khalid Baheyeldin kb at 2bits.com
Sat Aug 2 14:39:34 EDT 2014


On Sat, Aug 2, 2014 at 2:14 PM, Khalid Baheyeldin <kb at 2bits.com> wrote:

> Now, unlike the Amazon images, the full 3GB is allocated, instead of ~
> 300MB or so, and is not qcow2 format. It says x86 boot sector and lots of
> other info.
>
> virt-install refuses to allow me to specify a format when creating a new
> instance with a new hard disk image.
>
> file:
> t1.img:          QEMU QCOW Image (v2), 2361393152 bytes
> t2.img:          x86 boot sector; partition 1: ID=0x83, active, starthead
> 32, startsector 2048, 5242880 sectors; partition 2: ID=0x5, starthead 155,
> startsector 5246974, 1042434 sectors, code offset 0x63
>
> -rw-r--r-- 1 root   root  265M Aug  2 00:49 t1.img
> -rwxr-xr-x 1 root   root  3.0G Aug  2 14:08 t2.img
>
> Any way around this?
>

Answering myself ...

The image can be converted from RAW to QCOW2 using:

$ qemu-img convert -c -f  -O qcow2 t2.img t2-out.img
$ mv t2.img t2-raw.img
$ mv t2-out.img t2.img

$ ls -l *img
  3.0G Aug  2 14:08 t2-raw.img
 495M Aug  2 14:32 t2.img

So significantly less space used with the -c (compress) flag.

Once you boot the VM and find that all is well, you can delete the raw
image.
-- 
Khalid M. Baheyeldin
2bits.com, Inc.
Fast Reliable Drupal
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
For every complex problem, there is an answer that is clear, simple, and
wrong." -- H.L. Mencken
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20140802/2fdc130d/attachment.htm>


More information about the kwlug-disc mailing list