Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm traveling at the moment, and have moved one of the websites I'm working on to my MBP so I can work on it without a network connection. I've made an addition to the Mac's /etc/hosts file pointing the domain name to 127.0.0.1, and all's well.

I now want to get into Parallels and check the site from Windows browsers. How do I get things so that the Windows browser will understand the domain name and access the site? The Windows image obviously doesn't recognize / can't find the Mac's /etc/hosts file, and references to 127.0.0.1 in the Windows hosts file just as obviously point to Windows, not the Mac. Any advice out there? Thanks!

share|improve this question

3 Answers 3

up vote 4 down vote accepted

What IP address you use depends on what networking mode you chose for Parallels, but running ifconfig -a in a Mac Terminal window should give you some options. I would normally choose the addresses associated with the interfaces vnic0 or vnic1.

share|improve this answer
    
That worked very nicely; thanks! I found the inet address for vnic0 with ifconfig, pointed the domain name to that address in my Windows host file, and everything worked! –  Jim Miller Apr 8 '11 at 20:31

Sorry no windows user here neither OSX, but...

Does the virtual machine and the OSX share any network?

If it works with any private network (192, 172, 10, etc...) to share the connection with the virtual machines, you can try that addressing instead of the loopback networks.

Obviously the OSX web server should listen too in that shared-interface or that address.

share|improve this answer

The other answer is the truly correct answer, but this is another way for those who don't know how to use terminal, and just want to try something quick.

As a general rule, if you haven't modified the settings of the VM you should be in a range like 10.211.55.[1-254].

To get it the ugly way:

  • ipconfig from a command prompt and get your IP (ethernet adapter, ipv4)
  • change the last digit to a '2'. This will generally be the "parallels' network" address the host machine.
  • So, if you are 10.211.55.3, you can try 10.211.55.2.
  • 10.211.55.1 is your 'gateway', where all traffic not for your little network (you and host). This gets forwarded out to the world by parallels. So this is not the os-x host.

I would add an entry in your windows hosts file, so you can change it without breaking any scripts.

share|improve this answer

Your Answer

 
discard

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.