VMWare ESXi – Enable SSH and use wget

Downloading ISO images from Micorosoft Technet or various Linux mirrors sites is an action performed quite often under ESXi environments. I will normally store all my downloads and ISO files under a Datastore folder entitled “ISO” (shocking). However, getting the ISO files to the Datastore can be somewhat of a pain.

I will either start the download from my machine, wait until I get into the office to upload the file to the Datastore OR start a download on one of the boxes at the office and upload to the Datastore later. It would really be nice if I could start the download right from within the Datastore. Guess what? You can!!!

Thanks to Ray Burkholder @ One Unified, here are the steps.

VMMWare ESXi is installed and started with SSH disabled. To enable it is an unsupported option, as it allows a user access to the console, operating system and associated file system.

My primary reason for accessing the VMWare ESXi file system (vmfs), is the ease in which one can get ISO images on to the system. When running the VMWare Infrastructure Client, during the creation of a virtual machine, the virtual CD Drive can be attached to an ISO image resident in the DataStore, with the DataStore basially being the vmfs file system.

So to get read/write access to vmfs, one needs to activate SSH on VMWare:

  • At the console of ESXi host, press Alt-F1 to access bypass the simple management window and gain access to the console window.
  • There is no prompt and no text echo, but type unsupported and hit the enter key.
  • Enter the password you’ve assigned for root.
  • A prompt of ~ # will become visible.
  • Use vi to edit /etc/inetd.conf.
  • Find the line that begins with #ssh and remove the #, and save the file.
  • Use ps | grep inetd to find the existing inetd process id.
  • Restart the process with kill -HUP id.
  • You will now have access via SSH.

After logging in, the default datastore can be found at /vmfs/volumes/DataStore1. I created a sub-directory there named ISO to hold my ISO images. The directory and files are accessible from the VMWare Infrastructure Client when creating a new Virtual Machine. ISO files can be retrieved with the wget command.

I havn’t done it yet, but one could add a .ssh directory on /root, do the appropriate magic (covered in another article), and login with an ssh key rather than root password.

Much of the information here was extracted from a couple of web sites, with VM-Help being the primary one. It’s forum entries have additional useful information.

3 Comments

  1. [...] paid version of vSphere. However, automated “linked” cloning can be achieved by enabling the “unsupported SSH console” and this [...]

  2. [...] in perl, to utilize vmkfstools, OR the shell scripts ran under ESXi’s “secret” console, once SSH has been enabled. There must be sleeker more simplified way. Turns out there may [...]

Leave a Reply