Convert Virtualbox To Kvm
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.raw2 – Convert the RAW image into a QCOW file.
$ qemu-img convert -f raw MyTestVM.raw -O qcow2 MyTestVM.img3 – Voila. Go into virt-manager, create the machine, and use your newly created image.
Export Hyper V VhdxRecently we removed a 1/2 rack of servers from one of our data centers. That included our last two Microsoft Hyper-V 2012 R2 servers that hosted two VMs with historical STH Bench data for development. To make things slightly more interesting, the domain controller had been removed so we had Hyper-V hosts that were not responding to GUI tools and we had one day to move data off them. Not a great situation, but we wanted to show how you can quickly convert a Hyper-V VM to KVM. In this case, we are putting the VMs on a Promxox VE cluster so we can get the VMs on an all-flash Ceph storage array. Proxmox VE is a Debian Linux based platform that combines features such as KVM virtualization, containers, ZFS, GlusterFS and Ceph storage as well as cluster management all with a nice Web GUI. If you are simply using a Ubuntu, RHEL or CentOS KVM virtualization setup, these same steps will work minus the Proxmox GUI views.
Convert Virtualbox Vm To Kvm
Converting Hyper-V vhdx Virtual Machine for KVM UsageThe total process took a long time as we only had 100mbps of bandwidth between the three data centers free for this project. The actual hands-on-keyboard time took a matter of minutes for both VMs.
The trick is that our KVM system did not work with vhdx Hyper-V virtual machine drives so we needed to convert them into a qcow2 image (more on why later.) Step 1: Export the VM to get a clean VHDx snapshotHyper-V has a great snapshot and feature. The Hyper-V hypervisors we had setup had a very fast 40GbE interconnect and SSD storage so we could take many snapshots. The first step is to export the VM so you can have one vhdxx virtual drive to transfer and convert. If you can use the GUI, this is a few clicks away.
Export Hyper V Vhdx (demonstrated on a desktop copy and Hyper-V Manager)If you cannot get to a Hyper-V Manager GUI, then you will likely want to use the via PowerShell. If you get really stuck and cannot open a remote PowerShell session to the Hyper-V host, you can use RDP (if enabled) or iKVM on the server to get to a PowerShell prompt.Using the Export-VM command via PowerShell or via the Hyper-V Manager GUI ensures that you get a single vhdx file ready to transfer and convert. Step 2: Send the vhdx to the target KVM virtualization hostThis step is really easy, especially if you exported the VM to a network share location. If so, you can simply copy the resultant vhdx to the new server.
If you cannot, we have seen various other combinations of USB drives, SFTP clients and other methods to get the vhdx drive to the target server. Cdburnerxp disc at once mode. Step 3: Check the image before proceedingSince the transfer was likely many GB in size and we are going Windows to Linux, it is always good to check that the vhdx image does not have errors before proceeding. Here is the command where “Bench-Dev.vhdx” is the file we transferred.# qemu-img check -r all Bench-Dev.vhdx Hyper-V Vhdx To Proxmox Qcow2 Qemu-Img CheckAs you can see, the vhdx file passed with no errors reported.