VMware {code} Community
y_richard
Contributor
Contributor

How to get host machine name/ipaddress

I'm developing a test tool for VMWare. The test tool runs on VMWare guest OS and needs to talk to host OS. To do that I need to know the host machine name or ip address. So how do I detect host machine name or ip address inside guest OS? Thanks.

Reply
0 Kudos
2 Replies
dataduplex
Contributor
Contributor

There are few ways in which this can be accomplished

1) Using VMware-tools: You can set the ip address of host OS in the VMX file or using VMware-cmd. From the guest OS side, the same values can be retrieved using VMware-guestd. More information at http://jeff.bovine.net/VMWare_vmcontrol_API#VMControl_VMGetGuestInfo

I belive VmPerl is no longer supported by VMware, alternative would be VIX. http://pubs.vmware.com/vix-api/ReferenceGuide/

2) Using a common repository: Have agents running on host and guest OS. Agent on host machine can fetch the guest OS MAC address or bios UUID from the vmx configuration file. When guest OS comes up, agent running on guest OS can fetch MAC address or bios UUID from system. You can compare them to get the host address.

3) Using VMCI: I did not get a change to work with this. http://www.vmware.com/support/developer/vmci-sdk/

Reply
0 Kudos
dataduplex
Contributor
Contributor

One more way is to reverse engineer the UUID of the guest OS.

http://communities.vmware.com/thread/133174?tstart=0

Reply
0 Kudos