5

My Internet is slow relatively, so I need to download Ubuntu Server (ISO file) to my directory of VMware ESXi directly via ssh shell.

How can I do it?

muru
  • 193,181
  • 53
  • 473
  • 722
ASIL
  • 182
  • 3
  • 4
  • 16
  • Can you please explain your situation more clearly. Are you trying to install Ubuntu Server on a Virtual Machine? – AnotherKiwiGuy Nov 27 '16 at 20:25
  • @ThatGuy Not even now, I want to download the iso file put the main server to make this iso a local CD then use it in many times – ASIL Nov 27 '16 at 20:28
  • Updated my answer. – AnotherKiwiGuy Nov 27 '16 at 20:30
  • I don't understand the setup here. On which system do you need the ISO file, how is it connected to the internet and how can you access it? Maybe draw a diagram if you don't know how to explain it in English. – David Foerster Nov 27 '16 at 21:03
  • 1
    @DavidFoerster He's got ESXi server. He wants to download the ISO to the ESXi system so he can use it to create VMs with that ISO. (Hopefully this clarifies - he's got the same situation I had for a while) – Thomas Ward Nov 27 '16 at 21:06
  • Yes, This is what I need exactly (Save iso file from URL to my server directly via SHH Shell) – ASIL Nov 27 '16 at 21:08
  • @ThomasWard Thanks! I just looked up VMware EXSi and now that I now that it's a deployment and management tool for virtual machines the question makes a lot more sense. – David Foerster Nov 27 '16 at 21:10
  • @David Foerster & Thomas Ward Thanks! for your interested and sorry for my language. Is everything is clear now and you can help please don't late. – ASIL Nov 27 '16 at 21:16
  • @muru : Off-topic. Maybe ServerFault is the best choice. – SuB Nov 30 '16 at 20:48
  • @SuB [sf] is more likely to kick questions like these to [unix.se]. – muru Dec 01 '16 at 04:10
  • @muru: This question is not about Linux. This question is like "How to download and install Ubuntu server on a vmware machine using command line". You can replace Ubuntu server with Windows or Linux or any other OS, and the answer will be the same! – SuB Dec 08 '16 at 09:59

3 Answers3

9

To enable SSH access in the direct console

  1. At the direct console of the ESXi host, press F2 and provide credentials when prompted

  2. Scroll to Troubleshooting Options and press Enter

  3. Choose Enable SSH and press Enter once. On the left, Enable SSH changes to Disable SSH. On the right, SSH is Disabled changes to SSH is Enabled.

  4. Press Esc until you return to the main direct console screen.

After this you can use wget read man wget:

  • Connect to your ESXi via SSH
  • Change to the folder where you want to download the ISO
  • Run wget http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-server-amd64.iso

This will download the ISO directly.

Setting up an ISO store on your ESXi server:

  • Go to configuration > storage
  • Right-click on a datastore and select Browse
  • Created an ISO folder
  • Use SSH to mv the downloaded ISO to the new folder
AnotherKiwiGuy
  • 4,350
  • 1
  • 20
  • 38
  • this is work fine when I want to download into my local PC. but now I need to download into my server and it's doesn't work with. – ASIL Nov 27 '16 at 20:13
  • So what you're saying is you want to *install* it on your server, is that right? – AnotherKiwiGuy Nov 27 '16 at 20:19
  • It display this message when I try your code `wget: unrecognized option '--continue' BusyBox v1.20.2 (2014-08-27 12:48:18 PDT) multi-call binary. Usage: wget [-csq] [-O FILE] [-Y on/off] [-P DIR] [-U AGENT] URL... Retrieve files via HTTP or FTP ` – ASIL Nov 27 '16 at 20:20
  • Are you trying to *install* Ubuntu Server on the virtual machine? – AnotherKiwiGuy Nov 27 '16 at 20:22
  • 1
    @ASIL `--continue` doesn't exist on the VMware `wget`. Just download it with plain `wget`. Note that you are going to have a problem if the internet dies off, and the ability of us to provide insight to VMware's builtins on ESXi command shells is going to be limited. – Thomas Ward Nov 27 '16 at 21:04
  • 1
    @ThatGuy He wants to know how to download the ISO from within ESXi's SSH console/shell so he can save the ISO to the server so he can install Ubuntu Server to VMs. – Thomas Ward Nov 27 '16 at 21:05
  • @ThomasWard - Yup, I updated the answer to reflect that. Thanks :) – AnotherKiwiGuy Nov 27 '16 at 21:06
  • 1
    If the internet connection on the EXSi system turns out to be too flaky for download without wget's `--continue` flag, you could download a statically linked binary of GNU wget (with the currently available BusyBox wget) and use that. – David Foerster Nov 27 '16 at 21:12
  • `wget` on ESXi doesn't support ssl... you cant wget from https, only http or ftp – Bryksin May 28 '18 at 09:53
  • @Briksins - At the time of writing this answer, the Ubuntu ISO's were available on a non SSL enabled server (as you can see from the wget line). If you want to update the answer, then do so, but this is over a year and a half old, so it is likely out of date. – AnotherKiwiGuy Jun 01 '18 at 10:22
  • @ThatGuy unfortunatly I was downloading Windows ISO from http://windowsiso.net/, not Ubuntu, and it required ssl. There is nothing to update as the answer as I don't have a solution, however for the year and a half nobody in VMware fixed the problem and it still exists! Not supporting ssl is kind of crazy in our days – Bryksin Jun 01 '18 at 14:13
  • @Briksins - Probably a good idea to lodge a bug report [here](https://bugs.xenserver.org) – AnotherKiwiGuy Jun 02 '18 at 10:45
1

make sure you check the firewall too if you run in to any issues running wget prior. example:

esxcli network firewall set --enabled false

run wget again..

esxcli network firewall set --enabled true
Koti DC
  • 11
  • 1
1

Use aria2c to increase download speed by using multiple connections to get a file. Use -x to set maximum connection count for every download. Following command download Ubuntu ISO from its official website using 5 paralel connections:

aria2c -x5 http://releases.ubuntu.com/16.04.1/ubuntu-16.04.1-server-amd64.iso

Issue following command to install this tool if it isn't installed:

sudo apt-get install aria2
SuB
  • 4,119
  • 5
  • 24
  • 33