v2v: VMware-to-Cockpit (VM Migration Tools)
v2v is a utility tool designed to migrate virtual machines from VMware vCenter/ESXi directly into a persistent Libvirt virtual machine on the local host system (Vapor platform virtualization), utilizing virt-v2v.
It automatically installs all necessary migration packages (including virt-v2v, libguestfs, qemu-utils, and a compatibility kernel image) inside a self-contained Docker container.
The VM migration process is performed through Vapor. Once the migration process is successful, the VM will appear in Cockpit and can be managed through Cockpit.
Pre-flight Requirements
You need to install Docker to process migration.
To execute the migration successfully, the host system and the docker container require:
- Privileged Mode: Required to access host virtualization,
/dev/kvmhardware acceleration, and system sockets. - Libvirt Socket Access: Mount
/var/run/libvirtinside the container. - Storage Pool Access: Mount storage pool folders (such as
/var/lib/libvirt/imagesor/home/awanio/data/virtualcompute). - KVM Device Mount: Access
/dev/kvmfor fast guestfs appliance virtualization.
Running Migration via Vapor terminal
Processes 1 and 2 below are performed only once to install the Docker container. If the Docker container is already available, you only need to run process 3.
1. Download Image
To download image
docker run --rm r.awan.app/library/tools/v2v:v1.0.4 bootstrap > v2v-install.sh2. Install/run the image as a container:
sudo sh v2v-install.sh3. Migrate VM
A. Execute via Vapor terminal
You can run the migration tool either Interactively (recommended) or via CLI Arguments.
Interactively
This mode prompts you for connection settings and target properties, validating input dynamically and listing saved connections.
sudo docker exec -it v2v migrate-v2v -iWalkthrough:
- Credentials Selection: If saved credentials exist, choose a connection or choose to enter new details.
- Connection Type: Select
vpx(vCenter/vSphere) orssh(direct ESXi). - VMware Details: Host/IP, Username, Password, and connection-specific details:
- For
vpx: Datacenter path (e.g./Datacenter/Cluster/Host), SSL certificate verification skip. - For
ssh: Path to target guest.vmxfile on ESXi.
- For
- Credentials Storage: Choose whether to persist these credentials to
credentials.json(saved with restricted0600permissions). - Source VM: Name of the VM to migrate.
- Target Config: Target VM Name on Vapor, Target Storage Pool, and Network interface configuration (Network vs. Bridge mapping).
- Execution: Real-time console output of
virt-v2vconversion progress.
Standard CLI Mode
You can also run the tool non-interactively by specifying the command-line arguments:
# vCenter Example:
sudo docker exec -it v2v migrate-v2v \
--type vpx \
--host vcenter.example.com \
--username administrator@vsphere.local \
--datacenter-path /Datacenter/Cluster/Host \
--source-vm my-vcenter-vm \
--target-name my-vapor-vm \
--storage-pool virtualcompute \
--network-name default
# Direct ESXi/VMX Example:
sudo docker exec -it v2v migrate-v2v \
--type ssh \
--host esxi.example.com \
--username root \
--vmx-path /vmfs/volumes/datastore1/my-vm/my-vm.vmx \
--source-vm my-vm \
--target-name my-vapor-vm \
--storage-pool defaultCLI Options:
--interactive,-i: Launch interactive prompt.--type: Connection type (vpxorssh).--host: VMware host or IP address.--username: VMware connection username.--password: VMware password (if omitted, you will be prompted securely).--datacenter-path: vCenter Datacenter path.--vmx-path: Path to target guest.vmxfile on ESXi.--source-vm: Source VM name.--target-name: Name of the migrated VM on target Vapor.--storage-pool: Target storage pool (default:default).--network-type: Target network mode (networkorbridge, default:network).--network-name: Target network/bridge name (default:default).
B. Execute Migration from container terminal
Once the container status shows as running:
- Click the container actions dropdown and select the Terminal action.
- The container terminal will open. A banner tip will appear showing the migration command:bash
migrate-v2v -i - Type
migrate-v2v -iinside the terminal to run the interactive wizard, or launch it with the required CLI arguments directly.