In VirtualBox you can create VM and it will store it on a folder inside the Default Machine Folder of VirtualBox.
For instance, after create an ubuntu-headless
VM it will create an ubuntu-headless
directory with a couple of files and more folders inside.
I want to get this VM working on another system with also VirtualBox, like a duplicate.
Will a simple copy/paste of this VM directory inside Default Machine Folder of the target system work?
TL;DR: How to transfer a VirtualBox image from one system to another?
Copy/pasting the VM files is not the way to go. You need to use the correct export/import feature of VirtualBox.
With the following instructions you will be able to transfer a VM across several different physical machines and it's also a good way to make backups.
Export
Open VirtualBox and enter into the
File
option to choiceExport Appliance...
You will then get an assistance window to help you generate the image.
Enter the output file path and name
You can choice a format, which I always leave the default OVF 1.
Finally you can write metadata like Version and Description
Now you have an OVA file that you can carry to whatever machine to use it.
Import
Open VirtualBox and enter into the
File
option to choiceImport
You will then get an assistance window to help you loading the image.
Enter the path to the file that you have previously exported
Then you can modify the settings of the VM like RAM size, CPU, etc.
My recommendation on this is to enable the Reinitialize the MAC address of all the network cards option
Press
Import
and done!Now you have cloned the VM from the host machine into another one
Here's the procedure for exporting a virtualbox VM via the command line:
First, use
vboxmanage list vms
to determine which box you want to export, e.g.In this case, I'm going to export
vpn-client_1
To import, use
The
-n
option will prompt you for import options; seevboxmanage --help
for details.As an alternative, there's also a command line utility called
VBoxManage
. It'll likely reside in your/usr/share/virtualbox/
folder. UseVBoxManager export
andVBoxManager import
.