1

on a raw vsphere esxi 6 without any vm installed i have to setup vm's and ... remotely so i decided to open ssh to esxi and download an Ubuntu iso using wget this way:

wget http://releases.ubuntu.com/16.04/ubuntu-16.04-server-amd64.iso

but when i hit enter it returns with this error:

wget: bad address 'releases.ubuntu.com'

whats wrong with my approach?

*wget executed in this path vmfs/volumes/mydatastore/iso

Leo
  • 31
  • 1
  • 4
  • Why are you downloading an ISO direct to ESXi? You should really be using the proper tools for this. – GregL Jun 29 '16 at 22:29
  • 1
    @GregL : well,uploading an image not an option for me!the only thing I've is a limited internet connection to upload an iso and i prefer to just download it to my datastore and select it from there! be smart! – Leo Jun 30 '16 at 09:47

2 Answers2

1

Login to the server with ssh and run this command to setup a DNS server:

esxcli network ip dns server add -s 8.8.8.8

Then simply run the "wget" command.

wget http://releases.ubuntu.com/16.04/ubuntu-16.04-server-amd64.iso

Thank you James Sneeringer for your lifesaver comment.

1

Assuming you have DNS set up correctly for ESXi, wget could be incorrectly preferring the IPv6 address for packages.ubuntu.com:

$ host releases.ubuntu.com
releases.ubuntu.com has address 91.189.92.151
releases.ubuntu.com has IPv6 address 2001:7b8:3:37::21:3

Try forcing IPv4 mode:

wget -4 http://releases.ubuntu.com/16.04/ubuntu-16.04-server-amd64.iso

EDIT:

Sorry, it seems the Busybox version of wget included with ESXi does not support the -4 flag, or any other way to force IPv4 vs. IPv6. Make sure you are at least getting some name resolution by trying to ping the site:

vmkping -c 3 releases.ubuntu.com

If this works but wget does not, you may need to download the ISO to an intermediate system, and then transfer it to your ESXi host.

James Sneeringer
  • 6,835
  • 24
  • 27
  • `vmkping -c 3 releases.ubuntu.com` give me this `getaddrinfo() for "releases.ubuntu.com" failed (-2: Name or service not known)` and `host` instruction is `-sh: host: not found` and thank you so much for your help. – Leo Jun 29 '16 at 18:11
  • Did you configure DNS servers on the ESXi host? Yon can check with `esxcfg-info --network | grep 'Name Server'`. – James Sneeringer Jun 29 '16 at 18:20
  • It shows nothing! DNS configuration is the source of the problem, isn't it? – Leo Jun 29 '16 at 18:23
  • Correct. You can add one from the CLI with the command `esxcli network ip dns server add -s x.x.x.x`, where x.x.x.x is the IP address of the DNS server to use. You can verify it with `esxcli network ip dns server list` (which gives more precise output than the `esxcfg-info` command I previously gave you). – James Sneeringer Jun 29 '16 at 18:30