Server Fault is a question and answer site for system and network administrators. 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

When I create VMs, my automatic hostname is localhost.localdomain. This is creating some networking issues from my VM to another Windows computer that I have (cannot ping to my VM). How can I change my hostname of my VM? Do I need to also change it inside my VM as well as in the vSphere Client?

Update: I have changed my hostname of my RHEL VM to say "MyVM" and verified this in /etc/hosts and /etc/sysconfig/network. However, I am still unable to ping to MyVM from another Windows computer on my network. Does this have anything to do with the dnsdomainname? I get dnsdomainname: Unknown host. On my vSphere Client, it still says the Host is localhost.localdomain, but from your responses below, it should not matter about what the vSphere Client says..

Any thoughts?


share|improve this question
VMware is a company - which of their products are you using ? – Iain Apr 8 '11 at 19:25
Err I have VMware Hypervisor and the vSphere Client – O_O Apr 8 '11 at 19:37
Which hypervisor ? ESX/ESXi? – Iain Apr 8 '11 at 19:57
ESXi. Sorry for the confusion.. I'm a n00b. – O_O Apr 8 '11 at 19:59
Thanks & no worries - we're just trying to regularise the vmware-* tags as they got out of hand - cheers – Iain Apr 8 '11 at 20:17
up vote 2 down vote accepted

Is your VM linux or windows? If linux, edit /etc/hostname and /etc/hosts, to reflect the hostname you want. You do not need to change teh name in vsphere client, it does not affect networking at all.

share|improve this answer

If you want to change the host name of the OS within the VM, you need to change it accordingly inside the VM. The "host name" for the VM in vSphere is basically a nickname and the setting is under "Virtual Machine Name." You can change it to what ever you would like it has no direct tie to the virtual machine OS host name.

share|improve this answer

You will need to change the hostname in the VM as well as in the vSphere Client.

share|improve this answer
Hm, everyone else says that it doesn't matter if you change the hostname in the vSphere Client. If you do have to change it, how do you go about doing that? My VM host's hostname is also localhost. I cannot see a way to change this in the Configuration tab. – O_O Apr 8 '11 at 20:42

You need to change the host name within the VM. (depending on OS: Windows under computer properties, Linux you would need to edit the /etc/hostname & /etc/hosts files) Then you can right click on the VM in the vSphere client and edit the settings > Options tab. However, in the datastore the names will not change unless you migrate the VMs off the datastore (and back on if that's where you want them.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.