Tutorials

▷ How to migrate virtual machine in hyper

Table of contents:

Anonim

If there is something we must bear in mind when entering the world of virtualization, it is the compatibility between Hypervisors, that is why we are going to see how to migrate virtual machine in Hyper-V. The Microsoft Hypervisor is one of the most attractive options that we have in the window system. This is available natively on Pro, Enterprise and Education systems. So we must know how to import and export virtual machines in Hyper-V from tools like VirtualBox

Index of contents

Like any other Hypervisor, Hyper-V has the possibility of being able to import and export virtual machines. In this way, it is possible to migrate for example a virtual machine created in this program to VirtualBox. Of course, the reverse process is a bit more complex to perform, since Hyper-V does not support files with.OVA or OVF extensions. We'll cover all of this in this tutorial, so let's get started.

Export virtual machine in Hyper-V

We will start with the simplest process, that of knowing how to export a virtual machine in Hyper-V. This procedure is useful if we want to migrate a virtual machine from one Hyper-V to another. Let's see it step by step:

The first thing we will have to do is go to the main screen with the selected machine. The list of options in the right pane will be activated. We must click on " Export..."

Now we will proceed to select a folder where we want to store the export files. We must make sure that it is inside a specific folder, since the program will create several folders and files.

The process will start immediately and will last not too long. The end result will be a directory with three folders with configuration files and the main virtual hard disk in .vhdx format. This format allows you to create virtual hard disks of up to 64 TB, there is nothing, and it will be useful if you want to migrate the virtual machine to another Hyper-V with a different version or similar.

Import virtual machine into Hyper-V

Now we will do the reverse procedure. Located on another machine with Hyper-V, we will go to the main window and click on the option " Import virtual machine..."

Then a quick wizard will open in which we will have to select the location of the folder where the virtual machine that we want to import is.

Now we must choose the option " Copy Virtual Machine " to copy the files to our Hypervisor from the export directory.

In this simple way we will export a virtual machine from a Hyper-V export directory.

Migrate Hyper-V virtual machine to VirtualBox.

As Hyper-V is not capable of importing virtual machines in OVA or OVF formats, what we will have to do is convert their virtual machines in the VirtualBox compatible format, that is, from vhdx to vhd format. Let's see the procedure:

We start by going to the main Hyper-V window with the selected virtual machine. Now we give the option " Edit disk..."

Now we start a wizard in which it indicates which is the procedure that we are going to carry out. The first thing we will have to do is select the virtual hard disk that contains the Hyper-V virtual machine. As we will see, it will be in vhdx.

On the next screen, we will have several options for transforming the disk. In each of them we will have a brief explanation of the objective. We, of course, will give " convert ". We move on to the next phase.

Now we will have to choose the output format of the hard disk. We have it in vhdx, so we will choose the vhd format.

Once the previous one is done, we will choose the disc type option. The most recommended, of course, is to choose the option of " Dynamic Expansion ", in this way we will save the maximum possible space on our physical hard drive.

Finally we choose the directory for the location of the new virtual machine. Since we want to directly open it in VirtualBox, we are going to locate it on a USB. You can put it wherever you want, keep in mind that it will be a virtual machine like any other.

Now all that remains is to wait for the wizard to complete the operation.

Open VHD virtual machine in VirtualBox

Well, let's quickly go to our host with VirtualBox to see how to open this virtual machine that we have converted and check that it works correctly.

We go to VirtualBox and select the option to create a new virtual machine. As always, we choose which RAM we want to allocate to it.

But the most important thing here is to choose the option " Use an existing virtual hard disk file ", this is the key of the question. Now we proceed to look for our virtual hard drive in this extension and leave it loaded.

Click on " Create " and we will have the virtual machine attached to our Hypervisor VirtualBox.

It is possible that we will find an error when starting the virtual machine with the message: “ no bootable medium found ”. This error is caused by the system that has Hyper-V configured to start the virtual machines on it. If the virtual machine is generation 2, then we will need to make some extra configurations in VirtualBox, let's see them:

(optional) We go to the configuration options of the virtual machine. We must place ourselves on the " Storage " section and we must eliminate the DVD drive called " Controller: IDE"

(mandatory) Then we go to the " System " section and activate the " Enable EFI " option and place the hard drive as the first drive in the boot order list. In this way we will be able to start the virtual machine correctly.

This usually happens with operating systems other than Windows.

Migrate virtual machine from VirtualBox to Hyper-V

Now what we will do is the procedure to be able to open a VirtualBox virtual machine (.vdi format) in Hyper-V, which does not support this format.

Clone VDI virtual machine to VHD with VirtualBox

For this it will also be necessary to transform the virtual hard disk from vdi to vhd, let's see the procedure:

This, we must do with a tool in VirtualBox command mode that is in the following path:

C: \ Program Files \ Oracle \ VirtualBox

Inside it we must find the application " VBoxManage ", but we will have to open it with a command terminal. We are going to use PhowerShell.

To start PowerShell right in this directory, click on the “ Shift ” table and double-click on the window.

Once opened, we must know very well the path where our virtual machine is located, because we must place it in the execution command. In our case, it is on the following route:

D: \ vitual machines \ w10x64pro

So let's see how we should mount the command in PowerShell:

. \ VBoxManage clonemedium “virtual disk path.vdi” “virtual disk path.vhd” --format VHD

For example, in our case it would be like this:

. \ VBoxManage clonemedium "D: \ virtual machines \ w10x64pro \ W10x64pro.vdi" "D: \ virtual machines \ w10x64pro \ W10x64pro.vhd" --format VHD

The result will be the creation of a virtual hard disk that contains the machine in VHD extension.

Open VHD virtual machine in Hyper-V

Once the procedure is done, we will take our heavy file, and we will go to the host where we have Hyper-V to proceed to mount this virtual machine.

What we will have to do is the typical procedure to create a new virtual machine, that is:

We go to " Action -> New virtual machine " and start the wizard.

We must bear in mind that in the step of selecting virtual machine generation we must choose the " Generation 1 " option to obtain machine compatibility.

When we get to the virtual machine creation window for the virtual machine, instead of creating a new one, we will have to choose the option “ Use an existing hard disk ”. We will select our VHD hard drive and move on.

In this way we can connect our new machine and everything will go correctly.

Well these are the procedures for we can Import and export virtual machines from Hyper-V with other hypervisors like VirtualBox.

We also recommend:

What kind of virtual machines do you have? We hope this tutorial has been helpful to you in learning better the virtual machine import and export procedures.

Tutorials

Editor's choice

Back to top button