Hi folks, here is me again posting tips about virtualization instead of database management stuff. I’m doing this specially to document stuff I had to deal with that I’m pretty sure I won’t be doing any time soon. This is one of such things, move a Windows 7 VM from KVM to Virtualbox… so let’s get to it, shall we?
First thing you might be interested to do is changing the type of hard drive used in KVM to IDE. If you have problems, check this out:
The second thing is to convert the disk image from KVM to RAW using qemu.
# qemu-img convert -O raw Windows_7-KVM.qcow2 Windows_7VBOX.raw
Once the RAW disk is created, now it is necessary to convert it to VDI using VBoxManage.
# VBoxManage convertfromraw -format VDI Windows_7VBOX.raw /home/user/Windows_7VBOX.vdi Converting from raw image file="Windows_7VBOX.raw" to file="/home/user/Windows_7VBOX.vdi"... Creating dynamic image with size 85899345920 bytes (81920MB)...
Since I have been doing everything as root, I will now change the owner for the disk to my non-privileged user.
# chown user:group /home/brunomc/Windows_7VBOX.vdi
Finally we can create a VM on Virtualbox using the converted disk. Here is a brief overview:
Open up virtualbox and click on create virtual machine. Enter a name for the machine and click “Next”.
Select the amount of memory for the machine and click “Next”. In my example 3GB of RAM.
Now the most important part for this article, select the existing disk and locate your converted VDI.
Start the VM and check if it is working fine. Hope this helps 🙂