We can use the wget command to download ISOs directly from Microsoft or other providers, and store them on a vmWare Datastore. This negates the need to download the ISO on your device then upload it to the Datastore.
To do this we will use a command called wget. wget stands for “web get” and is a command-line utility for downloading files from the internet. It is available on various operating systems, including Linux, macOS, and Windows (through third-party tools or the Windows Subsystem for Linux).
With wget, you can retrieve files using HTTP, HTTPS, and FTP protocols, among others. It is commonly used for automated downloads, scripting, and batch downloading tasks. Some of its features include:
- Downloading single files: You can use wget to download a single file from a URL.
- Recursive downloads: wget can recursively download files from a given URL, which means it will follow links and download files from all the linked pages.
- Resuming interrupted downloads: If a download is interrupted or fails, wget can resume the download from where it left off, which is helpful for downloading large files.
- Downloading in the background: You can run wget in the background, allowing it to continue downloading even after you close the terminal or disconnect from the server.
Getting Started
Login to your ESXI host using SSH:
ssh [email protected]
Navigate to the directory where you want to download your ISO to. In my case i will be storing it in a datastore called “Datastore01”:
cd /vmfs/volumes/datastore1/
We need to change the firewall to allow downloading files via HTTP.
esxcli network firewall ruleset set -e true -r httpClient
Now enter the following command and replace “PASTE FILE URL HERE” with the download link of your ISO.
wget --no-check-certificate --user-agent="Mozilla" "PASTE FILE URL HERE"
By default the output file will be saved with the same name of the file on the server.
You can download a file a specify the output file name using the -O flag followed by the output file name.
wget --no-check-certificate --user-agent="Mozilla" "https://s
oftware-static.download.prss.microsoft.com/dbazure/988969d5-f34g-4e03-ac9d-1f9786c66750/19045.2006.220908-0225.22h2_release_svc_r
efresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso" wget -O "Windows-10-Enterprise.iso"
Output of the downloaded file: