In the last few days I have taken the juice out of virtualization using Virtualbox, since I am implementing software directly in virtual machines that are later transferred to the final servers or development environments, all this with the aim of offering solutions that simply need to be imported into Virtualbox to be used immediately. This is really a concept that people from TurnKey LinuxI am personally getting familiar with this way of distributing things and I think it seems quite efficient.
Among so many imports and exports of virtual machines, I had a problem on one of the guest computers and that is that did not allow importing the .ova into Virtualbox, something quite curious because the same .ova could be imported on another computer with the same version. The origin of the problem is still unknown to me, but if I can find a solution to be able to use the .ova in question without any problem, the steps are simple and I will share them below.
Solution to the problem of Cannot import the ova file in Virtualbox
I must clarify that this method does not allow importing corrupted Ova files, so in case your virtualbox does not allow importing because the file is not complete or you have a copy problem, this method will not work hence make sure your .ova file works properly.
If when importing a virtualized device into virtualbox you get an error message like the one in the following image, the method in question will probably solve your problem
The first thing we have to do is open a terminal in the directory where the original .ova file is located, then we execute the following command to unzip the .ova in the location of our preference.
tar xvf miova.ova -C /home/tudirectorio
This command extracts the three files that an ova contains: the .vmdk, .ovf and .mf, the file that interests us is the VMDK (.vmdk) (Virtual Machine Disk) which is the one that contains the disk information present in your virtual device.
The next thing we have to do is go to virtualbox and create a new virtual machine with the same configuration as the original, that is, the same architecture and operating system, in addition to adding the amount of ram that we want to use, finally we must choose to use a existing virtual hard disk file and choose the .vmdk that we imported in the previous step.
Finally, we create the virtual machine and we can run the virtualized environment without problem.