1

Using vmware's ovftool to export/backup virtual machines from an ESXi 6.7 host fails with error cURL error: couldn't connect to server, even if the specified password and the FQDN/IP of the server is correct and has no typos.

The command I used was

ovftool.exe 'vi://root:<mySuperSecurePassword>@xxx.xxx.xxx.xxx/location/of/vm' /path/to/outputfile
Yannik Z.
  • 193
  • 2
  • 12

2 Answers2

1

Both username and password must be URLENCODED, otherwise if you leave them blank it will prompt you, has nothing to do with password strength/special characters (except that you must urlencode them).

https://blog.edfine.io/blog/2017/05/02/how-vmwares-ovftool-gave-me-a-headache/

Jacob Evans
  • 7,886
  • 3
  • 29
  • 57
1

Simply use % followed by the hexadecimal value of the corresponding ASCII special characters.

A full list of hex values as a substitute for ASCII characters can be found in a Cisco appendix: ASCII Character Set and Hexadecimal Values


Example: A password like Th1s[F00%Passw?rd needs to be converted into Th1s%5bF00%25Passw%3frd before inserting it into the vi: command

This solution was initially provided by StefanAtwork in the vmware community, but I think it is a good idea to spread it out further on StackExchange.

Yannik Z.
  • 193
  • 2
  • 12
  • "password you provide must not contain any special characters" false – Jacob Evans May 25 '20 at 20:50
  • Read on, Jacob, and you will notice that I wrote exactly this. URL encoding IS in fact the procent encoding with ASCI hex-numbers. I still understand your point - my first sentence is misleading (at least if one does not continue reading on). Deleted it. – Yannik Z. May 27 '20 at 11:48
  • 1
    I think it needs to be understood that vi commands are passed over https and use http as the underline transport technology, as such variables like usernames and passwords when communicating between ovftool and esxi or vcenter (and vcenter logins containing @ or %40) as opposed to what you've experienced and what worked. as well as leaving out both variables will prompt for such credentials. – Jacob Evans May 27 '20 at 16:18
  • Fully agree on your statement. – Yannik Z. May 28 '20 at 17:07