• 0

[VirtualBox] Accessing a VM Webserver from Host Computer using Machine Name


Question

I need some help with running my virtualized XP on a Mac host. I'm using VirtualBox.

In my virtual machine, I have XP that's running the XAMP/PHP web server, that has multiple sub-domains set up. The machine name in the virtual machine is called "Child". When I open a web browser in the virtual machine and goto: http://child, I can see my web pages and it loads the CSS files from http://css.child.

However, in the Mac (Host) I cannot seem to access "Child" via http://child. I have added "Child" and all of the sub-domains to the Mac host files and flushed the DNS and still nothing! I can access Child via the IP (http://192.168.0.60), however, the sub-domains don't work.

My virtual machine is using a bridged network adaptor.

Please can someone help me? It's probably something very simple but I am totally perplexed. Thanks.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

My virtual machine is using a bridged network adaptor.

Here is your issue.

IIRC, you have to set the network adaptor to "host based", then on global virtualbox settings, you'll see the correct ip/network settings of the VM.

Link to comment
Share on other sites

  • 0

"I cannot seem to access "Child" via http://child. I have added "Child" and all of the sub-domains to the Mac host files "

And does it resolve?? If not then you did something wrong!

if you add a host to your host file, then clearly you should be able to access that IP you put via the host name. You say your your box is listening on that IP and if you access via IP it works, so verify that your host file is working correctly..

Simple enough just either ping the names you put in the host file.. if you host file is setup correctly then your name will resolve to that IP you put in your host, if not then you did it wrong.

Link to comment
Share on other sites

  • 0

It could be, but I don't understand how. Here is what my host file looks like:

127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0     localhost

192.168.0.60 child
192.168.0.60 css.child
192.168.0.60 js.child
192.168.0.60 thumbs.child
192.168.0.60 pic.child

I can ping "192.168.0.60" but not "child".

Link to comment
Share on other sites

  • 0

No No No he does not need host only adapter. Bridging is fine - he clearly has something wrong with his host file or even if he could not ping the IP it would still resolve to the IP.

when you type ping child does it say unknown host or does it return the IP, if it does not return the IP then you have a problem with your host file. You mac not using it or something?

Did you edit a sample file or something.

example - edit my host with your entries

127.0.0.1       localhost

192.168.0.60 child
192.168.0.60 css.child
192.168.0.60 js.child
192.168.0.60 thumbs.child
192.168.0.60 pic.child



D:\>ping child

Pinging child [192.168.0.60] with 32 bytes of data:

Reply from xxx.xxx.193.201: Destination host unreachable.
Reply from xxx.xxx.193.201: Destination host unreachable.
Reply from xxx.xxx.193.201: Destination host unreachable.
Reply from xxx.xxx.193.201: Destination host unreachable.

Ping statistics for 192.168.0.60:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

D:\>ping pic.child

Pinging pic.child [192.168.0.60] with 32 bytes of data:

Reply from xxx.xxx.193.201: Destination host unreachable.
Reply from xxx.xxx.193.201: Destination host unreachable.
Reply from xxx.xxx.193.201: Destination host unreachable.
Reply from xxx.xxx.193.201: Destination host unreachable.

Ping statistics for 192.168.0.60:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms


see still resolved those names to 192.168.0.60, even though I currently don't have any route to a 192.168 network, so it fails - but as you see it still resolves!

Resolving of that host to the IP has nothing to do with virtualbox - your issue currently is your mac. You need to have it resolve to that IP or no your not going to be able to access it via name. Does mac not use resolv.conf ? You would have to tell it to use host file??

What version of OS X are you using?

lookupd -configuration

Look for the following in the output:

LookupOrder: Cache FF DNS NI DS

_config_name: Host Configuration

I believe FF refers to your host file, need to now what order your box is set to resolve with - if told to check dns first, etc. or might even be set to no use host file.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.