Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have IIS running on my local machine and a couple of virtual machines so I can test Internet Explorer 6, 7, & 8. I can't seem to get them to find localhost. Any ideas?

share|improve this question
2  
The localhost in each VM is the VM itself. How did you setup the connection to the internet? In the VM's? Or are they connected at all to the internet? –  paradd0x Feb 21 '11 at 18:02
    
They're connected to the internet. In settings I have them set to shared networking (NAT). fyi, I also tried connecting via ip address which didn't work either –  Pardoner Feb 21 '11 at 18:15
    
@Pardoner: [Late comment, but] in NAT mode, you cannot access the host from the VM or vice versa. –  grawity Mar 23 '11 at 20:43
    
@grawity: Actually, the way NAT works, usually the guest can access the host. –  Hello71 Mar 23 '11 at 21:47
    
@Hello71: Hm, didn't think about that. –  grawity Mar 24 '11 at 15:38

3 Answers 3

Each virtual machine behaves exactly the same as a real physical computer on a network, so the host should be referred-to by its IP address, not by the name localhost.

If you do not know the host's IP address, enter ipconfig in a command-prompt (cmd). It will be in the entry next to the adapter. The adapter itself depends on the network configuration used for the VMs. If you are not sure which, the simplest solution is to also use ipconfig in the VM to figure-out the adapter.

The IP address of host and VM should agree on the network prefix, which could be 192.168.1.xxx or similar.

share|improve this answer
    
thanks. I figured this would be the case but I'm new to Windows and not sure how to make the machine available to the network. Can you point me in the right direction? –  Pardoner Feb 22 '11 at 0:53

You most likely have an active firewall.

That's why I had the exact same problem with my Virtual PC IE6 client...

Added a new inbound rule for port 80/443, and now I can access my IIS hosted websites on my local PC just fine.

To do this (on Windows 7), go to run, and type "windows firewall", then click on "Windows Firewall with Advanced Security"

Select "Inbound Rules" on the left, and then click New Rule.. on the right, then follow the wizard.

share|improve this answer
    
And that is why while using Win 7 and accessing the network I choose Work Network option since it disables most of the Windows Firewall rules and I can use whatever else to protect myself. –  Darius Mar 23 '11 at 19:11

For me, I had to edit my hosts file ("C:\Windows\System32\drivers\etc\hosts", requires Admin rights) and add an entry associated with my route IP like:

192.168.1.1      laptop

Then create a binding for laptop:50000 in IIS. I chose a high port like 50000 to make it easy to present multiple sites to Virtual PC (Windows security gets more meddlesome in the 4-digit and below ports).

I opened that port in Windows Firewall.

I made sure Virtual PC had only one Network Adapter setup, my Wireless Adapter, so it would get a real IP from my router.

That did it - any browser in WinXP on Virtual PC can access IIS sites I setup this way.

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.