How to download files from URL to VMware ESXi using SSH Shell of it?
Solution 1
To enable SSH access in the direct console
At the direct console of the ESXi host, press F2 and provide credentials when prompted
Scroll to Troubleshooting Options and press Enter
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.
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
Solution 2
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
Solution 3
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
Related videos on Youtube
ASIL
Updated on September 18, 2022Comments
-
ASIL almost 2 years
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?
-
AnotherKiwiGuy over 7 yearsCan you please explain your situation more clearly. Are you trying to install Ubuntu Server on a Virtual Machine?
-
ASIL over 7 years@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
-
AnotherKiwiGuy over 7 yearsUpdated my answer.
-
David Foerster over 7 yearsI 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.
-
Thomas Ward over 7 years@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)
-
ASIL over 7 yearsYes, This is what I need exactly (Save iso file from URL to my server directly via SHH Shell)
-
David Foerster over 7 years@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.
-
ASIL over 7 years@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.
-
SuB over 7 years@muru : Off-topic. Maybe ServerFault is the best choice.
-
muru over 7 years@SuB Server Fault is more likely to kick questions like these to Unix & Linux.
-
SuB over 7 years@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!
-
-
ASIL over 7 yearsThis is the result
-sh: aria2c: not found
-
ASIL over 7 yearsthis 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.
-
deadhacker1900 over 7 years@ASIL : Ive installed it before so i think it's installed by default. Thanks to SuB
-
ASIL over 7 yearsMy server based on VMware ESXi. If you can help please don't late. thanks for your interested
-
AnotherKiwiGuy over 7 yearsSo what you're saying is you want to install it on your server, is that right?
-
deadhacker1900 over 7 yearsYour sever is a VM inside VMware ESXi?
-
ASIL over 7 yearsIt 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 over 7 yearsNo, I want to download the file into the main server (VMware ESXi)
-
AnotherKiwiGuy over 7 yearsAre you trying to install Ubuntu Server on the virtual machine?
-
Thomas Ward over 7 years@ASIL
--continue
doesn't exist on the VMwarewget
. Just download it with plainwget
. 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 over 7 years@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.
-
AnotherKiwiGuy over 7 years@ThomasWard - Yup, I updated the answer to reflect that. Thanks :)
-
David Foerster over 7 yearsIf 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. -
Briksins about 6 years
wget
on ESXi doesn't support ssl... you cant wget from https, only http or ftp -
AnotherKiwiGuy about 6 years@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.
-
Briksins about 6 years@ThatGuy unfortunatly I was downloading Windows ISO from 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
-
AnotherKiwiGuy about 6 years@Briksins - Probably a good idea to lodge a bug report here