When trying to join ESXi host to an AD environment the following error is received:Error: LW_ERROR_INVALID_MESSAGE [code 0x00009c46]
VMware vSphere ESXi 8.x
A misconfigured /etc/hosts file that omits the target ESXi host's FQDN causes this error.
example:
# Do not modify this file directly, please use esxcli.127.0.0.1 localhost.localdomain localhost::1 localhost.localdomain localhost###.###.###.### esxi-host
Update the /etc/hosts file to include the target ESXi host's FQDN. Additionally, verify that the localhost configuration contains the correct loopback IP, short name, and FQDN.
Connect to the ESXi host via SSH.
Navigate to the configuration directory by running: cd /etc
Open the hosts file in the text editor by running: vi hosts
Add the FQDN by pressing i to enter insert mode, then typing the IP address followed by the FQDN and short name (e.g., 192.168.1.10 host.domain.local host).
Example of /etc/hosts file updated to include FQDN:
Do not modify this file directly, please use esxcli.
127.0.0.1 localhost.localdomain localhost::1 localhost.localdomain localhost###.###.###.### esxi-host.sample.com esxi-host
Save and exit the file by pressing ESC, typing :wq!, and pressing Enter.