In my case I’m using an Ubuntu workstation and downloaded the appropriate ovftool and unzipped into a directory of choice. Prepare the VM on ESXi dashboard, shutdown and remove all snapshots. Back at the workstation, I choose to use terminal in most tasks and this is no exception therefore I navigated to the expanded directory on my desktop in terminal. Navigate to the directory and make the file executable.
cd ~/Desktop/ovftool/
sudo chmod +x ~/Desktop/ovftool/ovftool
Using the address or name of your ESXi host find the path to the VM targeted for backup.
ovftool vi://192.168.XXX.XXX
Output will show an error then a listing of VMs in the resource pool. Make note of the names. Quite simply the command is ovftool vi://hostname/vm_name /path/to/location/vm_name.ova After proper credentials are provided the copy will begin.
ovftool vi://192.168.xxx.xxx/myVM_v3 /media/jon/Storage/myVM_v2.ova
Making an alias
Once ovftool is downloaded and expanded let’s move the directory to /usr/bin/
sudo mv ofvtool /usr/bin/
make the files executable
sudo chmod +x /usr/bin/ovftool/ovftool
sudo chmod +x /usr/bin/ovftool/ovftool.bin
Make an alias to use at command line. Now we can use ovftool at the command line without having to navigate to the directory.
alias ovftool=/usr/bin/ovftool/ovftool