When working with remote ESXi hosts, direct console access isn't always available. The vSphere Client (either HTML5 or Windows version) becomes our primary interface. For this scenario, we have:
- ESXi 6.7+ host (remote location)
- USB HDD formatted with VMFS or FAT32/NTFS
- Stopped/ Powered-off VM (recommended for clean export)
First, verify the USB drive is recognized by ESXi:
# SSH into ESXi host (if enabled)
ls -l /vmfs/volumes/
lsusb
Through vSphere Client GUI:
- Right-click the powered-off VM → Clone → Clone to Template
- Select "Export OVF Template" format
- Choose USB drive location (typically appears as datastore)
- Enable "Include BIOS UUID" if needed for licensing
For advanced users with SSH access:
# Locate VM files
find /vmfs/volumes -name "*.vmx" | grep "VM_NAME"
# Create export directory on USB
mkdir /vmfs/volumes/USB_DRIVE/vm_export
# Use vmkfstools for disk cloning
vmkfstools -i /vmfs/volumes/DATASTORE/VM_NAME/VM_NAME.vmdk \
/vmfs/volumes/USB_DRIVE/vm_export/VM_NAME.vmdk -d thin
# Copy configuration files
cp /vmfs/volumes/DATASTORE/VM_NAME/*.vmx /vmfs/volumes/USB_DRIVE/vm_export/
cp /vmfs/volumes/DATASTORE/VM_NAME/*.nvram /vmfs/volumes/USB_DRIVE/vm_export/
After export completes:
# Check file integrity
cd /vmfs/volumes/USB_DRIVE/vm_export
sha1sum *.vmdk > checksums.sha1
# Verify disk consistency (for thick provisioned)
vmkfstools -e VM_NAME.vmdk
USB Drive Not Visible:
Check storage adapters in vSphere → Host → Configure → Storage → Storage Adapters
Permission Errors:
chmod -R 777 /vmfs/volumes/USB_DRIVE/vm_export
esxcli storage core claiming reclaim -d naa.xxxxxxxx
Insufficient Space:
Use df -h
to verify available space before transfer
Before proceeding, ensure:
- ESXi host version is 6.5 or later (older versions have different procedures)
- VM is completely powered off (not suspended)
- USB drive is formatted with VMFS, FAT32, or NTFS
- You have SSH access enabled on ESXi host (for alternative methods)
The simplest approach for most users:
- Right-click the powered-off VM in vSphere inventory
- Select
Export...
from the context menu - In the export dialog:
Destination Type: Local Disk Directory: /vmfs/volumes/usb-drive-name/ Create separate folder: [Checked]
- Monitor progress in Recent Tasks panel
For advanced users preferring CLI:
# First identify your USB drive datastore
esxcli storage filesystem list
# Then clone the VM (example for VM named 'webserver')
vmkfstools -i "/vmfs/volumes/datastore1/webserver/webserver.vmdk" \
"/vmfs/volumes/usb-drive/webserver_clone/webserver.vmdk" \
-d thin
Issue: "Insufficient permissions" error
Fix: Ensure your vSphere user has these privileges:
Datastore.AllocateSpace
VirtualMachine.State.PowerOff
VirtualMachine.Provisioning.Clone
Issue: USB drive not visible
Fix: Run these commands via SSH:
esxcli storage core adapter rescan --all
ls /vmfs/volumes/
For cross-platform compatibility:
ovftool vi://username:password@esxi-host-IP/vm-name \
/vmfs/volumes/usb-drive-identifier/vm-name.ovf
After completion, verify file integrity:
cd /vmfs/volumes/usb-drive/vm-folder
vmkfstools -e vmname.vmdk | grep "VMFS extent"