Reputation: 1779
I have a VMWARE Workstation installation on my Windows 7 box hosting an Ubuntu VM guest; the networking mode is setup as 'Bridged'. The guest OS gets its own IP address from the corporate DHCP server.
I have a LAMP environment installed on the guest VM. I can launch Firefox on the guest OS and type either 'http://localhost'
or 'http://myguestmachinename'
and the local web pages show up fine. However, in the host machine I can only access access the guest by typing its IP address; I'd like to share the guest OS web pages with others and so the changing IP address model is not good.
With similar network setup I have some Windows guest OS hosting web pages and they can be accessed fine by using the hostnames. So there is something different about Ubuntu and/or Apache--perhaps something that needs to be configured in that guest OS.
Here are the outputs from various files
interfaces file
The loopback network interface
auto lo iface lo inet loopback
The primary network interface
auto eth0 iface eth0 inet dhcp
hosts file
127.0.0.1 localhost 127.0.1.1 mylocalubuntu
The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters
hostname file
mylocalubuntu
sources.list file
Any advice? Thanks!
Upvotes: 0
Views: 1362
Reputation: 349
Corporate DHCP and Linux don't always cooperate. Assuming your VM is using eth0 and that the hostname is "myhostname," add this to /etc/network/interfaces
iface eth0 inet dhcp
hostname myhostname
(Edited because original instructions were for Red Hat, not Ubuntu.)
And then "sudo ifdown eth0 && sudo ifup eth0." After that run an nslookup of your hostname. If you're lucky your corporate DNS will return the proper bridged address.
Upvotes: 0
Reputation: 888
Make sure you check that the following are configured in ubuntu:
/etc/network/interfaces
/etc/hosts
/etc/hostname
/etc/apt/sources.list
make sure your hostname does NOT have underscores.
If none of the above works, consider adding enabling ssh access between guest OS's.
Upvotes: 0