FTP access to an ESXi datastore

Or how to get your stuff off an ESXi ‘free edition’ box.

FTP server

There are many ways to get at your datastores on an ESXi box.
The web interface. You could enable support mode and scp files around. Or you could even use the datastore browser in the vsphere client.

I however was looking for a way to move these large data files onto another linux storage server.
In my case, the web ui and scp were extremely slow. At their current rate, it was going to take days to copy all my stuff off.

That’s when I came across Dave’s article on how to enable a FTP server on an ESXi box. Again using static binaries. Lovely.

I condensed the process in to a shell script. Just download this archive.
Unzip and run the install.sh script in the recovery console.

This will copy the files into the correct locations, change their permissions and add them to the inetd.conf file.
Remember; with ESXi, these changes only persist until the next reboot.
Any user account in ESXi will be able to login via FTP.

Its FTP folks. Don’t try this on an untrusted network.
Your info is going across the wire in plain text.
…its going so fast… Should be done by tomorrow.

Add php5-cli and rsync to your esxi server

My new favorite toy is a box running ESXi.

ESXi is a strange beast. I’m used to using linux based host OS’s so the limitations of ESXi are a little frustrating. No direct access to physical drives, no direct access to USB devices, ESXi only knows how to read its own proprietary files system vmfs.
For all the headache, its much faster than a linux host and has a ton of configuration options via the vSphere client software.

The no cli thing bugs me a lot. The only supported way to interact with esxi is via the vSphere client software.
It does include sshd, but its off by default.
There are lots of articles on how to enable this mode.

Once you’ve got SSH access, you’ll quickly discover that most of the commands your used to in linux are missing.
Including perl, rsync, etc…

Since there are no dev tools, no gcc, or glib headers for this kernel, you can’t compile software directly on the host either.
Ah, but if you can build it into a static binary, it will run!

I’ve found an rsync binary and a php binary.
Installing these opens doors for writing useful scripts with esxi.

Login as root, plop these into your /bin/ directory and make them executable with a chmod a+x and your good to go.

Not quite that easy. The binaries work, just /bin doesn’t persist between reboots. You’ll need to place your utilities in a persistent storage location to keep them around.