If you have pre-configured or pre-installed VirtualBox virtual machines on your computer with the XML file, you can easily add to the VMs list in VirtualBox. Usually, when you create a new VM from the interface, it comes under the VMs list. But if you have VMs which installed in a different host or from other versions of Windows OS from the same host, you can use the following method easily import/add to the current list. In this small post let me show how to import VMs using XML file in VirtualBox.
You can avoid the creation of new VMs if you can import the old existing machines. Also, this method brings the all settings, VM state and even the snapshots.
Here is my current list of VMs. I’m going to import/add a Linux Ubuntu VM which was installed in my previous OS but stays in the same host.
1) Go to Machine and click Add.
2) Browse the XML or vbox file of the virtual machine you want to import here.
3) This would add the particular virtual machine to VirtualBox’s VMs list.
That’s it, its very simple. If there was no option to import the XML file like this, we may have to create a new virtual machine and select the existing base hard disk VDI file.
One important thing should be considered here, if the pre configured virtual machine’s XML and other files moved or copied from a different partition or computer, then the imported virtual machine will not work properly. Because, the configuration file XML or vbox will be having the disk, snapshots, attached drives and log files located in the different partition based on old host.
Either these files should be copied properly on the correct location in the new host as per on XML file or, modify the XML file with the correct drive letter of the VM’s new location. I’m sure this method would be easy and simple to move/import the earlier VMs from another location or host.