VMware Cloud Community
meimeiriver
Enthusiast
Enthusiast

How do I send an email in ESXi 6?

I'm trying to something as simple as sending an email from my ESXi 6 host (via cron). So, I see python is installed! Great! But what do I get?!

ImportError: No module named smtplib

Sigh. So, I try to install the required lib. Seems VMware has gone out of its way to frustrate every aspect of that too: either they have removed the required packages to install other ones, or totally crippled the dependencies. So, that's a bust too.

[RANT] To the powers that be, would it really kill you not to be such total *sshats about ppl installing stuff, like the ability to send mail, that you should have already %^&*()^%$^&* included yourselves in the first place!? ESXi is the first OS, ever, I encountered, where the makers deliberately try to hinder you in every way possible. [/RANT]

So, how can I send an email on ESXi 6.0?

0 Kudos
2 Replies
TheVElement
VMware Employee
VMware Employee

My recommendation would be to setup public key authentication and have your cron script on the ESXi host send an email from an external Linux host.

There is an excellent article on setting up public key authentication from an ESXi host at How to SSH between ESXi 6.0U2 hosts without providing a password - CormacHogan.com.

Note: This setup is more than likely not officially supported by VMware (additional caveats and warnings mentioned in the above article).

0 Kudos
peetz
Leadership
Leadership

ESXi is not a regular Operating System, but a stripped down "embedded like" system that serves only the purpose of running VMs. It only includes the software that is absolutely necessary for acting as a hypervisor and managing ESXi itself (e.g. python is used by a lot of ESXi system services and management scripts/tools).

You should not try installing your own software or running your own scripts inside ESXi, and - if you try it nevertheless - you will notice that it is much more difficult than with your average Linux system because of its own unique system architecture. You can read more about the ESXi architecture here: Architecture of VMware ESXi

Whatever you are trying to achieve: Use another system for it. VMware e.g. provides the VMA appliance for system administration purposes (see vSphere Management Assistant Documentation), but basically any Linux (or Windows) VM can do the job of sending an e-mail.

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de
0 Kudos