If you're running VirtualBox on multiple PCs, you may occasionally need to move virtual machines to another host. There are two methods for this task. First, you can copy the VM files to the new host and register them there. Alternatively, you can export the VM as an appliance and import it on the target PC.
Thomas Joos

If the hosts run on different operating systems, you'll need to find the appropriate methods for file transfer. If you use external storage devices for the VMs and want to mount them on another host, the file system must be compatible with the target host.

Regardless of the method you choose, the VM must be shut down and turned off.

Method 1: Copy VM Files and .vbox to target computer

When moving VMs between different hosts or re-registering a VM on the same host, the vbox file in the VM directory plays a critical role. This plain text file contains all configuration data, including the virtual drive, memory size, screen resolution, network settings, and the virtual hardware in general.

To transfer a VM to another computer, you need to copy the VM folder, including the .vbox file, to the other computer, or, if it's on an external drive, connect it to the remote computer.

Registering the VM in VirtualBox after the Transfer

To reconnect a VM or import it on another computer, select Machine => Add in VirtualBox.

Register the virtual machine after transferring the files

Register the virtual machine after transferring the files

Then choose the .vbox file of the VM and add it. Alternatively, double-clicking the vbox file will suffice if the file extension is associated with VirtualBox.

It's crucial that all other VM files, including the virtual hard drive image and the NVRAM and vbox-PREV files, are in the same directory since they're linked to the VM. Generally, it's a good idea to check the VM's configuration after moving, especially the settings for the virtual networks.

Registering the VM in Terminal or command line

Another option is to register a VM using the command-line tool vboxmanage.exe, located in the VirtualBox installation directory.

Registering the Virtual Machine on the Command Line in VirtualBox

Registering the Virtual Machine on the Command Line in VirtualBox

To register a VM, enter the following command:

vboxmanage registervm <path and name of the vbox file>

Method 2: Migrating VM as an Appliance

Another way to migrate a VirtualBox VM to another host is to export the VM as an appliance. Start the process in VirtualBox via File => Export Appliance.

Start the wizard for exporting a VM in VirtualBox

Start the wizard for exporting a VM in VirtualBox

This launches a wizard where you first choose which VM to export. Using the Expert Mode button gives more control options, but the default guided mode is usually sufficient.

In the next window, select the directory and format to which you want to export the VM. Typically, you'll choose the "Open Virtualization Format 1.0."

Export VM as OVF Appliance

Export VM as OVF Appliance

Afterwards, transfer the OVF appliance to the desired computer to import the VM there. On the next page, you can adjust settings and manage the appliance's description.

Adjust VM Settings During Export

Adjust VM Settings During Export

The assistant then exports the VM as an OVA file.

Importing Virtual Appliance

Conversely, you can then operate the VM on the target host using the command File => Import Appliance. Again, it's essential to check various settings.

Import Appliance on the target host

Import Appliance on the target host

If both hosts are on the same network, adjusting the name and IP addresses is necessary.

Conclusion

VirtualBox runs on hosts with various operating systems but uses the same format for all VM files (configuration, virtual drives, etc.). Thus, virtual machines can be easily moved between various hosts.

Subscribe to 4sysops newsletter!

There are two methods for this purpose. First, you can copy the folder with all VM files to the target host and re-register the virtual machine there. Alternatively, you can export the VM as a Virtual Appliance and import it on the target computer.

0 Comments

Leave a reply

Please enclose code in pre tags: <pre></pre>

Your email address will not be published. Required fields are marked *

*

© 4sysops 2006 - 2024

CONTACT US

Please ask IT administration questions in the forums. Any other messages are welcome.

Sending
WindowsUpdatePreventer

Log in with your credentials

or    

Forgot your details?

Create Account