Say you have a apple hardware, that you installed a VMware ESXi server, is it legal and possible to install a Mac OS X on that hypervisor, and access it remotely, say with RDP or Logmein or whatever to use it as a remote desktop environment?
Apple loosened restrictions around OS X and virtualization with Lion. Previously on OS X Server could be virtualized and even then, only in narrow circumstances. With Lion you could virtualize the non-Server OS X version.
The Mavericks EULA maintains the Lion virtualization clause. Specifically it says:
(iii) to install, use and run up to two (2) additional copies or instances of the Apple Software within virtual operating system environments on each Mac Computer you own or control that is already running the Apple Software, for purposes of: (a) software development; (b) testing during software development; (c) using OS X Server; or (d) personal, non-commercial use.
So you can:
- Only virtualize on Apple hardware (which you say you're doing);
- Only virtualize non-Server for development, testing or "personal, non-commercial use" otherwise you have to use the Server version of OS X (which is a $20 add-on to Mavericks from the App Store)
Fall within the bounds of the above-mentioned restrictions and yes, you can virtualize OS X in your ESXi environment.
Legally you cannot install OS X on a non-apple branded computer without writen permisson from Apple. You didn't specify which version of OS X you would installing but I'm assuming Mavericks, see the licensing agreement section 2(A). I'm sure there is similar wording in most of there software licensing agreements.
As others have noted, it's legal to install one OS X virtual machine on Apple hardware. According to VMware, it's possible to install Mavericks in ESXi 5.5.
(Note that OS X has some secret sauce which prevents it from booting unmodified on VMs which are not hosted on Macs. For example, an OS X VM will shut down if you try to start it on a Windows host.)
It's a limitation set in the esxi local.sh corefile. There is an unlocker available to permit OS X on non-Apple hardware, but it will break the EULA licence terms.