I do what I can

Random thoughts from Mauricio Teixeira…

Convert from VirtualBox to KVM

with 7 comments

Quickest and dirtiest way to convert your VirtualBox machine into a KVM machine.

First of all, make sure you have enough space. If you have created a dynamically growth disk, the virtual disk has been defined as 20GB in size, but is only currently using 8GB, you will need 28GB extra (8 for the original file you already have + 20 for the temp file + 8 for the final file). If you’re using disks with pre-allocated size, you will need 2 times extra the space (20 original + 20 temp + 20 final, in this example).

1 – Convert the VirtualBox VDI file into a RAW image.

$ VBoxManage clonehd --format RAW MyTestVM.vdi MyTestVM.raw

2 – Convert the RAW image into a QCOW file.

$ qemu-img convert -f raw MyTestVM.raw -O qcow2 MyTestVM.img

3 – Voila. Go into virt-manager, create the machine, and use your newly created image.


Written by netmask

março 3, 2010 às 01:20

Publicado em Uncategorized

Tagged with , , ,

7 Respostas

Subscribe to comments with RSS.

  1. Salut,

    thanks for this introduction. But what will
    happen with images, that uses driver/extensions
    from VirtualBox.
    Do i firstly have to remove them or are they
    also supported in KVM/Qemu

    Christian Groove

    dezembro 7, 2010 at 08:11

    • In my tests I had to do absolutely nothing. Not only the guest OS learned the new hardware, but it also ignored the VBox extensions (you can manually remove later).


      dezembro 7, 2010 at 14:15

  2. […] Convert from VirtualBox to KVM março, 2010 2 comentários 4 […]

  3. does not work for me.

    all ubuntu10.04 vbox 3.16
    kvm 0.12.3
    guest ubuntu10.04

    no bootable device


    agosto 2, 2011 at 20:41

    • well, I just show a way to convert the disk image. after that it’s up to you to fix the OS. you need to boot in rescue mode and rebuild initrd (rationale: initrd loads hardware-specific kernel modules, so if you change from kvm to virtualbox it’s a different “hardware”).


      agosto 21, 2011 at 09:48

    • All you have to do is mark the disk as bootable. After that KVM should boot it. I know, late reply,… but I had the same problem. Maybe the next one is more lucky and finds this answer usefull.


      julho 25, 2012 at 09:15

Deixe um comentário

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair /  Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair /  Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair /  Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair /  Alterar )


Conectando a %s

%d blogueiros gostam disto: