How to convert Hyper-V VM to VirtualBox or vice-versa

A lot of times we are required to migrate our virtual machine to a different hypervisor platform such as VirtualBox or Hyper-V. In this post, we will discuss how you can convert Hyper-V VM to VirtualBox or VirtualBox to Hyper-V in detail so that you can perform the migration with ease.

convert Hyper-V VM to VirtualBox or vice-versa

Convert Hyper-V VM to VirtualBox or vice-versa

Before we go ahead and start moving our virtual machines, you need to ensure that your machines are shut down. Otherwise, there is a high chance that the newly created virtual machine will either be corrupted or doesn’t have all the data present in the former machine.

Convert Hyper-V VM to VirtualBox

Let us first see how we can convert a Hyper-V virtual machine to VirtualBox. But before that, you need to install Oracle VirtualBox, it’s third-party software and is not pre-installed on your computer. So, go to virtualbox.org to install it on your computer. Once done, follow the steps mentioned below to do the same.

  1. Launch Hyper-V Manager.
  2. Right-click on the machine you want to convert and click on Export.
  3. Now, you need to navigate to the location where you want the machine to be stored. Make sure to paste the location somewhere as it will be used later.
  4. Once the export is completed, go to the location, open the VM’s folder, and then double-click on Virtual Hard Disk.
  5. Now, we need to disable the Hyper-V feature using the following steps.
    • Search “Turn Windows features on or off” in the Search menu and open it.
    • Untick Hyper-V.
    • Click Apply > Ok.
  6. Now, reboot your computer.
  7. Once your system is up, we will start converting the VHDX file to VDI. For that follow the steps given below.
    • Open Command Prompt.
    • Now, navigate to the VirtualBox location using the Change Directory or CD command. So, you can run cd C:Program FilesOracleVirtualBox.
    • Now run the following command.
      VBoxManage.exe clonemedium disk "locationfilename.vhdx" locationfilename.vdi
  8. Once the conversion is completed, we will have a new file with a .vdi extension.
  9. Now, let us create a new virtual machine in VirtualBox with the VDI that we just extracted. Follow these steps to do the same.
  10. Open Oracle VirtualBox, and click on New.
  11. Follow the on-screen instructions till you reach the Hard Disk section, you need to select, Create virtual hard disk now.
  12. Navigate to the path where we converted the Hyper-V machine to VDI and select the .vdi file.
  13. Finally, adjust the configuration of the virtual machine as per your liking.

That’s it! You can now launch your machine and use it without an issue.

Read: How to speed up a VirtualBox Virtual Machine and make it run faster?

Convert VirtualBox VM to Hyper-V

Let’s learn how to convert a VDI format disk for VirtualBox to VHD format for Hyper-V using the command prompt and vboxmanage.exe utility. As mentioned earlier, turn off your machines before doing anything. Once done, follow these steps.

  1. Take note of the folder where your VDI file is stored and where you need to store the converted VHD file.
  2. Then, open Command Prompt as an administrator from the Start Menu.
  3. We need to run the following command.
    vboxmanage.exe clonehd "C:VirtualBoxVMsLinuxLinux.vdi" "E:NewLocationtLinuxNew.vhd" --format VHD
  4. Make sure to replace the file path and name with the actual file path that we asked you to copy earlier and let the cloning complete.
  5. Once the cloning is completed, go to the new location and check if VDI is there or not, most probably it will be there.
  6. Open Hyper-V on the destination server. Then, create a new virtual machine and give it a name and folder location. When it comes to creating a virtual disk, select the option to “Use an existing virtual hard disk”, and provide the path to the converted file that you have ready beforehand.

Finally, follow the on-screen instructions to create a new machine.

Read: How to convert Physical Machine to Virtual Machine in VirtualBox?

How to transfer Hyper-V VM to VirtualBox?

To transfer a Hyper-V VM to VirtualBox, you need to export the existing virtual machine and convert the format using Command Prompt to VDI. Once you have the VDI file, create a new virtual machine using it. For instructions on how to do all this, see the aforementioned guide.

Read: How to convert VMware to Hyper-V and vice versa?

How to convert Hyper-V to VM?

With the help of the vboxmanage.exe utility, we can convert the .vhdx (Hyper-V) to .vdi (VirtualBox). You can open Command Prompt and then run VBoxManage.exe clonemedium disk "locationfilename.vhdx" locationfilename.vdi to convert Hyper-V hard disk to VirtualBox, to know more, check out the guide mentioned earlier.

Original Article