15

I'd like to download a large OS install ISO directly to my datastore. I used to be able to SSH to the ESXi terminal and use wget to download large files directly to the datastore, but it seems that wget can't handle https links anymore (wget: not an http or ftp url).

I'm wondering how others handle this. I know I can download the file to my laptop and use the datastore browser to upload it, but that's a two-step process (not to mention horribly inefficient when I'm offsite and accessing ESX through a VPN).

Thanks in advance for any suggestions!

ebarrere
  • 360

6 Answers6

6

Hopefully, you have a running guest system on the existing VMware setup... That's one quick option. If linux, you can wget/curl. If Windows, just download as normal.

I typically download .ISO files to the vCenter server and upload to the datastore from there. That's easy since my vCenter is usually a Windows server, so any complex download authentication methods are easy to deal with.

wget does exist in ESXi, so maybe the best option is to get the .ISO file you need to a location that does not require an https download; http or normal ftp.

Also see: cURL on ESXi 5.0?

ewwhite
  • 201,205
3

Assuming you are using 6.7U2 or higher as mentioned by Jerone, ensure that your firewall allows outgoing connections (it's disabled by default) and use the --no-check-certificate option to wget.

esxcli network firewall ruleset set -e true -r httpClient

wget --no-check-certificate
'https://releases.ubuntu.com/20.04.3/ubuntu-20.04.3-live-server-amd64.iso'

Should do the trick nicely.

3

Just SSH-proxy the file download operation through another system with an SSL-enabled wget. Note that the default ESXi firewall policy blocks outgoing SSH, so it needs to be allowed first. From the ESXi shell :

esxcli network firewall ruleset set -r sshClient -e true
ssh proxyhost curl -s https://server/path/file.iso >/vmfs/volumes/vmfs_name/path/file.iso
esxcli network firewall ruleset set -r sshClient -e false
3

Around ESXi 6.7, the embedded busybox wget finally started to support https.

So finally, you can do https downloads in ESXi.

Yay!

This is from ESXi 6.7 Update 2.

[root@ESXi-X9SRI-3F:/tmp] wget https://www.example.org
Connecting to www.example.org (93.184.216.34:443)
index.html           100% |******************************************************************************************|  1270  0:00:00 ETA
[root@ESXi-X9SRI-3F:/tmp] wget --help
BusyBox v1.29.3 (2018-11-02 15:37:50 PDT) multi-call binary.

Usage: wget [-c|--continue] [--spider] [-q|--quiet] [-O|--output-document FILE]
    [--header 'header: value'] [-Y|--proxy on/off] [-P DIR]
    [-S|--server-response] [-U|--user-agent AGENT] URL...

Retrieve files via HTTP or FTP

    --spider    Only check URL existence: $? is 0 if exists
    -c      Continue retrieval of aborted transfer
    -q      Quiet
    -P DIR      Save to DIR (default .)
    -S          Show server response
    -O FILE     Save to FILE ('-' for stdout)
    -U STR      Use STR for User-Agent header
    -Y on/off   Use proxy
[root@ESXi-X9SRI-3F:/tmp] vmware -l
VMware ESXi 6.7.0 Update 2

Whereas 6.5U2 still did not support it (I think ESXi 6.7 also did not, but I do not have a box to this this on any more):

[root@ESXi-X10SRH-CF:/tmp] wget https://www.example.org
wget: not an http or ftp url: https://www.example.org
[root@ESXi-X10SRH-CF:/tmp] wget --help
BusyBox v1.22.1 (2018-07-23 19:34:04 PDT) multi-call binary.

Usage: wget [-csq] [-O FILE] [-Y on/off] [-P DIR] [-U AGENT] URL...

Retrieve files via HTTP or FTP

    -s  Spider mode - only check file existence
    -c  Continue retrieval of aborted transfer
    -q  Quiet
    -P DIR  Save to DIR (default .)
    -O FILE Save to FILE ('-' for stdout)
    -U STR  Use STR for User-Agent header
    -Y  Use proxy ('on' or 'off')

[root@ESXi-X10SRH-CF:/tmp] vmware -l
VMware ESXi 6.5.0 Update 2
2

You don't mention the laptop OS. Assuming it is Windows, you can use WinSCP.

Log into your ESXi host, drill into your datastore, and do a filecopy using a Commander style, or optionally a Windows Explorer style interface.

If you are looking for a command line option, you can use Putty Secure Copy client.

I use both - gui for one off file copies, and command line to copy files to several ssh hosts.

RobW
  • 2,816
1

Wget from busybox on ESX doesn't support https URLs.

wget --help
BusyBox v1.20.2 (2012-12-11 11:54:28 PST) multi-call binary.
Retrieve files via HTTP or FTP

So, either try http or use above workarounds.