Tech

Tip: Swap, convert & clone finished VMs


When setting up new virtual computers, a lot of time can be saved under certain conditions: You can exchange, convert or clone an operational guest system in order to use it with various virtualization programs.

For the exchange of virtual machines, the Open Virtualization Format (OVF) was developed by the Distributed Management Task Force (DMTF) back in 2007. The standard describes an “open, secure, portable, efficient and expandable format for the packaging and distribution of software that runs in virtual machines” – independent of software platforms and processor architectures. Either

Vmware Workstation Pro
as well as

Virtualbox
support the import and export of OVA files. This TAR-based file archive contains the virtual hard disk in VMDK or VDI format and an OVF descriptor file.

Export OVA files

The export of a virtual machine as OVA is done quickly. The OVA can then be imported again. All the necessary settings for the virtual machine are already available. The import / export differs from copying a virtual hard disk, since a new VM has to be created and the existing hard disk has to be integrated.

Virtualbox:

You initiate the export of a virtual machine under “File -› Export Appliance “or with the key combination Ctrl-E. An assistant opens. In the first step, select the desired VM and click on “Next”. Then accept “Open Virtualization Format 1.0” as the format and enter the output path after File after clicking on the yellow folder symbol. The file name is adopted, but can be changed. Leave the setting “Only include Mac addresses of the NAT network adapters” and click “Next”. In the next window leave everything blank except “Name” and click on “Export”. The process starts and takes 15 to 30 minutes – depending on the size of the virtual machine.

Vmware Workstation Pro:

You can also export existing VMs with this virtualization software. Select the desired virtual machine in the VMware program on the left and choose “File -› Export to OVF “. In the following dialog, enter the target directory and the file name. Confirm by clicking the “Save” button. The export begins – be patient.

See also:

Exchange files between VM and host PC

Import appliances

In Virtualbox click on “File” and select “Import Appliance”. Enter the path to the folder in which the VM with the extension OVA is saved and click on “Open” and “Next”. In the “Appliance Settings” dialog, the most important parameters of the virtual machine are displayed, including the “guest operating system”, the number of CPUs used and the reserved main memory. Here you can adjust settings directly. Click on “Import”. Then the VM appears in the left column of Virtualbox. When starting up for the first time, the specific drivers of Virtualbox are installed. For better Windows integration, set up the guest additions.

Importing into VMware Workstation Player / Pro is just as easy: Click on “Open a Virtual Machine” and follow the instructions. You set the storage path and continue. As with Virtualbox, some drivers are installed in the imported guest computer and you should set up the guest additions.

Convert virtual disks

Virtualbox, Vmware Workstation Pro and Workstation Player (pictured) support importing appliances.

Enlarge

Virtualbox, Vmware Workstation Pro and Workstation Player (pictured) support importing appliances.

Virtual PCs that run with

Vmware Workstation Player
or Pro are available as VMDK files. These virtual hard disks cannot be used under Windows Hyper-V, as the program only supports VHD (X) files. In Virtualbox, however, the VMDK files can be integrated.

The free program

Starwind V2V Converter
converts VMDK images to VHD (X) files for use in Windows Hyper-V. By the way, VHDs can also be converted to VMDK files for Vmware. Virtualbox is not supported by the software.

Install Starwind V2V Converter and then start the tool. In the English-language user interface select “Local file” and click on “Next”. In the “Source image” window, open the selection dialog by clicking on the three dots behind “File name”. In the drop-down box after “File type”, “All supported image files” is preset for all supported formats. You can see this after clicking in the drop-down box. VMDK (Vmware) as well as VHD and VHDX (Microsoft) are supported. Qemu’s IMG and QCOW2 files are irrelevant to us. In our example we select a VMDK file with Windows 10 and confirm with “Next”. In the “Select location of destination image” window, accept “Local file” by clicking on “Next”. Then select “VHD / VHDX” as the file format and continue with “Next”. For the transfer in Hyper-V under Windows 10 then select “VHDX growable image” and check the box in front of “Activate Windows Repair Mode”. Clicks on “Next” and “Convert” start the conversion. Make sure there is enough free hard disk space. The conversion begins, which may take some time. The VHD file is then also located in the directory of the VMDK file – the file name is adopted.

Then integrate the VHDX file into a new Hyper-V virtual machine by selecting the “Use existing virtual hard disk” option in the “Connect virtual hard disk” window and specifying the file path. Proceed with the setup.

Some hardware drivers may be installed in the guest system when the VM is started for the first time in Hyper-V. Then the virtual machine is ready to go.

License question:

Use software in the VM

Clone virtual machines

In order to secure virtualized computers, you do not have to laboriously collect the individual files and copy them to a data carrier. This works much more easily using the clone function of the virtualization software.

Virtualbox
: First shut down the virtual PC that you want to duplicate. Then right-click on this machine and select “Clone” from the context menu. In the dialog box that then opens, you can enter your own name for the copy or accept the program’s suggestion. If you intend to use the original and the clone at the same time, it is important to activate the checkbox “Assign new MAC addresses for all network cards” – otherwise network problems may arise. Then select the clone type, whereby a full clone means more independence, and specify whether existing safepoints should be included. A click on “Clone” then starts the process, which can take longer depending on the size of the virtual hard disk. The replicated computers have their own sub-folders in the directory in which Virtualbox saves the virtual machines. The file type of the original is always retained when cloning via the graphical user interface. A VMDK file taken over from VMware does not become a VDI file in this way.

Vmware Workstation Pro
: Right-click in the main Vmware window on the switched-off virtual machine that you want to duplicate. Call up the “Manage” and “Clone” entries in the context menu. An assistant opens in which you first specify whether the current status or an existing snapshot should serve as the starting point for the cloning process. Then select “Create a full clone” as the clone type. A linked clone (“Create a linked clone”) saves storage space, but can only be used in connection with the underlying virtual machine. Linked clones are suitable, for example, for setting up differently configured test PCs, but not as a full backup copy. Enter a name for the copy or accept the program’s suggestion. Under “Location” you specify the folder in which the replicated machine will be saved. Clicking on “Finish” starts the process, which can take some time depending on the size of the virtual PC.

Tags

Related Articles

Back to top button
Close
Close