I do this by passing the string from host to guest through machine.id. This requires changes to the host (in every VM.vmx file too), and it does not automatically detect the host name of the host, but it works. On the host with the virtual machine turned on, edit the .vmx file for the virtual machine. Find or add a line that looks like this:
machine.id = "<string>"
Set <string> to some identifying string that tells you the server name. It can be a host name, or it can be a shortened version, or even some strange code, if you prefer, if you know what that means. If, however, the .vmx file has a line that sets
isolation.tools.machine.id.get.disable = TRUE
line feed will not work, so if this line is present, you can either delete / comment on it or set the value to FALSE .
In the guest OS, if you have VMware tools installed, you can do this (for Linux guests):
vmware-guestd --cmd 'machine.id.get'
or (for Windows guests that I have not tried):
VMwareService --cmd machine.id.get
Thomas Lee
source share