Convert XVA Virtual Machine to VMDK
This book will cover how to convert a VM exported from Xen Orchestra in XVA format to a VMDK.
- Preparing Your Machine
- 1. Installing XVA-img
- 2. Extracting the XVA to Raw Disk
- 3. Convert disk.raw to VMDK
Preparing Your Machine
1. Installing XVA-img
These are the instructions on how to install the XVA-img tool which is updated and patched for checksum and xxhash
1. Installing XVA-img
1.1 Installing xva-img from source
Objective: Install xve-image from source on an ubuntu 20.04 LTS machine in order to convert from XVA to a VMDK to be imported in VMWorkstation
Step 1. Navigate to eriklax/xva-img: XVA (Citrix Xen format) virtual disk tool. Supports RAW disk image exports and imports. (github.com) and download the entire zip file of the repository. In this situation, I am using wget on the Linux machine to download in my current directory.
Step 2. From terminal, unzip everything to whatever directory you want. I chose '/opt'
change directory to where the zip file is located.
cd /opt/xva-img
Unzip the Master zip file you just downloaded from git
unzip master.zip
Step 3. Change directory into the unzipped directory of 'xva-img-master'
Step 4. Install the dependencies for xva-img as noted on the github page, and install from source
-
sudo apt update && sudo apt install cmake g++ libssl-dev libxxhash-dev
-
Once installation has completed, you will build from source to install
-
Note: It will be easier to run as root from this point
-
Change directory into the xva-img repositry folder
-
cd /opt/xva-img/xva-img-master
-
-
Build
-
cmake .
-
make
-
make install
-
-
This is the final step installing xva-img on to your machine.
2. Extracting the XVA to Raw Disk
In this Chapter, I will cover how to use xva-img to extract the disk from the XVA file to a raw disk which will later be converted to a VMDK
2. Extracting the XVA to Raw Disk
2.1 Extract the XVA File to Raw Disk
Objective: Extract the disk from the from the XVA to a raw disk to be converted to VMDK.
Step 1. Navigate to a location that you would like to work from. In my scenario, I am working from my user's home directory in a folder name 'XVA VMs'
Belows is a screenshot of my working directory
Step 2. Once inside the working directory, run the following commands as root
-
mkdir my-virtual-machine
-
tar -xf my-virtual-machine.xva -C my-virtual-machine
-
chmod -R 755 my-virtual-machine
Step 3. Next we are going to export the Disk by utilizing disk-export command
xva-img -p disk-export my-virtual-machine/Ref\:4/ disk.raw
The Ref: number may vary. The way to get the correct number is to run the ls command against the "my-virtual-machine directory where the ova.xml and disk files are located. Reference the below screenshot.

Extraction Process Complete
It will take a little bit of time to extract, but the -p command when exporting will show you the current progress. Once it completes, you will have a 'disk.raw' file unless you decide to name it 'somethingelse.raw'
This completes the extraction of the disk from the XVA file. You can now examine the disk raw or convert it to any other format such as qcow2 or vmdk.
3. Convert disk.raw to VMDK
This chapter will discuss how to take the extracted raw disk from the XVA file and convert it to a vmdk
3. Convert disk.raw to VMDK