LinuxCommandLibrary

vboxmanage-export

Export virtual machines to an appliance format

TLDR

Specify the target OVA file

$ VBoxManage export --output [path/to/filename.ova]
copy

Export in OVF 0.9 legacy mode
$ VBoxManage export --legacy09
copy

Export in OVF (0.9|1.0|2.0) format
$ VBoxManage export --[ovf09|ovf10|ovf20]
copy

Create manifest of the exported files
$ VBoxManage export --manifest
copy

Specify a description of the VM
$ VBoxManage export --description "[vm_description]"
copy

SYNOPSIS

vboxmanage export <vmname|uuid> --output <filename.ovf|.ova> [options]

PARAMETERS

<vmname|uuid>
    Specifies the name or unique identifier (UUID) of the virtual machine to be exported.

--output <filename.ovf|.ova>
    Defines the full path and name for the output file. The extension must be either .ovf (for an OVF directory structure) or .ova (for a single OVF archive file).

--ovf20
    Exports the VM using the OVF 2.0 standard instead of the default OVF 1.0. This may offer better compatibility with newer virtualization software.

--manifest
    Includes a manifest file (.mf) in the exported OVF package. This file contains SHA-1 checksums of all other files in the package, allowing for integrity verification upon import.

--preserve-mac-addresses
    Instructs VirtualBox to retain the MAC addresses of the virtual machine's network adapters in the exported package. By default, new MAC addresses are generated upon import to avoid conflicts.

--dry-run
    Performs a simulated export without actually writing any files. This is useful for checking if the command syntax is correct and if there are any potential issues before committing to a full export.

--product <name>
    Sets the product name metadata within the OVF package, providing identification for the exported VM.

--vendor <name>
    Sets the vendor name metadata within the OVF package, indicating the creator or provider of the VM.

--version <version>
    Sets a version string metadata for the exported VM, useful for tracking different iterations or releases.

--description <text>
    Adds a custom descriptive text to the OVF package, providing more detailed information about the virtual machine.

DESCRIPTION

The vboxmanage export command facilitates the creation of a portable package for a VirtualBox virtual machine. This package, typically in Open Virtualization Format (OVF) or its archive variant (OVA), encapsulates the virtual machine's configuration, disk images, and other associated files into a single, standardized bundle. This is highly useful for several purposes:

Backup: Creating a complete snapshot of a VM for disaster recovery.
Sharing: Distributing a pre-configured VM to other users or systems.
Migration: Moving a VM from one VirtualBox host to another, or even to other virtualization platforms that support OVF/OVA, such as VMware vSphere or KVM (with proper conversion utilities).

The command allows specifying metadata like product, vendor, and version, making the exported package more informative. It ensures that the VM's state, as of the export time, is preserved for later re-importation.

CAVEATS

Exporting a virtual machine can consume significant disk space, as the output file includes all virtual disk images.

For a consistent export, especially for production VMs, it is highly recommended to power off the virtual machine before exporting. Exporting a running or saved-state VM might lead to inconsistencies or issues upon import into different environments.

While OVF/OVA is a standard, perfect compatibility between different virtualization platforms is not always guaranteed. Some features or settings might not translate perfectly when imported into a non-VirtualBox hypervisor.

OVF VS. OVA

The Open Virtualization Format (OVF) is a directory containing multiple files: an XML descriptor file (.ovf), virtual disk files (.vmdk, .vdi, etc.), manifest (.mf), and certificates (.cert). The Open Virtualization Appliance (OVA) is a single file archive (a TAR archive) that bundles all these OVF components together. OVA is generally preferred for simpler distribution and sharing, while OVF allows for easier inspection of individual components.

EXPORTED CONTENT

When a VM is exported, the OVF/OVA package typically includes:
Virtual Machine Configuration: CPU, RAM, network adapters, storage controllers, etc.
Virtual Disk Images: The actual data disks associated with the VM.
Metadata: Information such as product name, vendor, version, and description.
Snapshots: Note that only the current state of the VM (including its base disk and any merged snapshot data) is exported, not individual snapshot branches for independent restoration.

HISTORY

The `vboxmanage` command-line utility is an integral part of Oracle VM VirtualBox, a virtualization product originally developed by Innotek GmbH, later acquired by Sun Microsystems, and then by Oracle Corporation. The `export` functionality has been a fundamental feature of VirtualBox since its early versions, providing a robust mechanism for VM portability and distribution, aligning with the growing need for standardized virtualization formats like OVF/OVA.

SEE ALSO

vboxmanage import(1), vboxmanage clonevm(1), vboxmanage snapshot(1), vboxmanage modifyvm(1)

Copied to clipboard