Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been using VMWARE for quite a while. In order to visit guest machine from host machine, usually I would create a bridge interface in the guest machine and using ssh to login to the guest machine. The problem of this method is that after every guest machine restart, I need to recheck the ip address of guest machine because I can only use DHCP in the bridged interface.

so I'm wondering is there a way that I can login the guest machine by host name instead of by bare IP address? then I can just give a name to my putty session and simple use this saved session every time I'd like to login to the guest machine.

share|improve this question

The MAC of the virtual network card will not change between boots, so if your DHCP setup allows you to assign fixed addresses to interfaces this way that is the easy route. If you are using a cheap router's DHCP feature you might not have this option, but good routers will and if the DHCP server is a Linux or a Windows box then you definitely can. Will the most common dhcp server found in Linux distributions something like this in the config file will do the trick:

host somevirtualmachine {
  hardware ethernet 00:0C:29:36:BC:91;

To find the MAC of the network interface in a Linux, run ifconfig and look for the HWaddr for the interface. VMWare may also present the information on its management screens.

If you can not set a fixed address on the DHCP server then you could set a fixed address in the VM if there is part of your range that the DHCP server doesn't hand addresses out of (it is common to let DHCP set addresses for part of the range such as 192.168.X.2-128 and reserve the rest for devices that need fixed addresses). How to do that depends on your OS (editing /etc/network/interfaces on Debian style Linux setups).

You could also look into dynamic DNS, though if you are not setup to be able to give fixed addresses via DHCP then you probably aren't set to configure dynamic DNS locally either.

NOTE: You should give more detail in your question about your setup, particularly what OS is running in the VMs and the device responsible for handing out addresses via DHCP. I've assumed Linux in the examples above but it'll all work with Windows too (you'll just need to ask a Windows admin for details).

share|improve this answer

This depends on the host and guest operating systems, but I'm guessing you have Windows as host and some form of Linux as guest.

The most common protocol for local name resolution is NBNS (NetBIOS) – used by all versions of Windows, slightly inefficient due to use of broadcasts but compatible with pretty much everything.

If the guest is Linux, install Samba and start its nmbd component (smbd is not necessary here), this will allow the guest to be reachable by name.

To reach the host from the guest, add hosts: ..... wins to /etc/nsswitch.conf.

An alternative is mDNS – used mainly by Mac OS X, but also available for Windows (part of Apple's "Bonjour Print Services") as well as Linux (in the form of avahi-daemon and nss_mdns).

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .