Just use proper quoting and string security.
You could even simplify it a little and shore up the quoting by not executing variables:
# Get list of virtual machines. VMname will hold the address of the .vmx file
VMname="$(./vmrun list)"
echo "$VMname"
# Get list of snapshots
echo "./vmrun listSnapshots '$VMname'"
snapshotList="$(./vmrun listsnapshots "$VMName")"
# Get list of virtual machines. VMname will hold the address of the .vmx file
VMname="$(./vmrun list)"
echo "$VMname"
# Get list of snapshots
echo "./vmrun listSnapshots '$VMname'"
snapshotList="$(./vmrun listsnapshots "$VMName")"