Make guest name visible to host

3

I have Ubuntu running in VMware Player. I am able to access an Apache instance on this VM by using the IP address but not by machine name.

How do I make the name of the VM visible to the host? How do I add the machine name to my DNS? I am running within a Windows network.

Agnel Kurian

Posted 2009-04-22T10:29:32.463

Reputation: 2 197

Why the close vote? If we can discuss editors, furniture and interviews then why can't we discuss networking? FYI, I'm trying to set up SVN on the VM and access that from the host. Does that make it "programming related" enough? – Agnel Kurian – 2009-04-22T10:50:10.807

I agree. I don't know why we shouldn't talk about these topics here on SO as well. Networking for many programmers is an important part of what they have to deal with. – None – 2009-04-22T10:58:40.913

@martin it's a slippery slope, but definitely not programming related. – saschabeaumont – 2009-04-22T23:51:16.187

@Roger Pate: I believe the title: "Make VM Machine name..." would make it more obvious that we're talking about VMs here. Also, this is more Google friendly than "guest" to those who are searching for VM related quries. – Agnel Kurian – 2010-08-27T08:39:13.543

@Vulcan: I was avoiding "Virtual Machine Machine" (from "VM Machine"), but if there's a tweak you'd like to apply, feel free. – None – 2010-08-27T09:42:26.627

Answers

1

Put it in either DNS or in /etc/hosts.

EDIT: If the host is a Windows machine, put it in C:\WINDOWS\system32\drivers\etc\host.

Both are bascially the same syntax, which is

IP hostname1 hostname2 hostname3 ...

e.g.

127.0.0.1 localhost localhost.mydomain.tld

Martin C.

Posted 2009-04-22T10:29:32.463

Reputation: 233

1

Or use mDNS, giving your name an automacic .local domain.

apt-get install avahi

or see: http://avahi.org/

Josh

Posted 2009-04-22T10:29:32.463

Reputation: 7 540

0

If the host is Windows: Go to C:\Windows\System32\drivers\etc\ open file "hosts" and add a line:

IP Address Hostname

example:

192.168.1.5 ubuntu

If the host is Linux

sudo vi /etc/hosts

Then the same.

Mariano

Posted 2009-04-22T10:29:32.463

Reputation: 121