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 installed a Virtual PC with Windows7 and opened connection to my machine's localhost.

My computer's name is memphis, I added the following line in hosts file:

127.0.0.1 memphis

and I also updated IIS default website bindings to include:

memphis, 80, All unassigned

Now, in the virtual machine IE9 I typed:

http://memphis/

This worked well, and displayed directory content... Then I added a new website under IIS, and changed it's bindings to

localhost 900, and memphis 900

On my machine that works well, but in Vritual PC IE I typed:

http://memphis:900/

And I get Page cannot be displayed... what is going on? Why couldn't I access a different port on the Virtual PC?

share|improve this question
    
So you're trying to access an HTTPD that is running on the host, from your guest? –  Oliver Salzburg May 23 '13 at 9:15
    
Might not be relevant but in your example you use a comma before the port number: "memphis, 80, All unassigned", but in the new website bindings you have "localhost 900, and memphis 900". –  Leathe May 23 '13 at 9:19
    
@leathe no they are the same, I use the console in IIS to add new binding that's all –  Ayyash May 23 '13 at 9:28
    
@OliverSalzburg well if I understood your question, I am trying to run a site on my local machine IIS (the host) on the Virtual PC (the guest) –  Ayyash May 23 '13 at 9:29
    
Does the host/guest allow port 900 through at all? –  Leathe May 23 '13 at 9:46
show 1 more comment

1 Answer

up vote 2 down vote accepted

When you install a Virtual PC instance, it's like a completely new computer, localhost will refer to two different machines depending on if you're resolving it on the host (your physical computer) or the guest (the Virtual PC instance).

You don't have to put anything into your hosts file to make your computer name known to the host. The host knows its own name.

You can put the name of your host into the hosts file on the guest, but as long as they're sharing the same network, this shouldn't be required (due to Windows' peer-to-peer name resolution), but it shouldn't hurt either.

The port used by your HTTPD (IIS) will always be 80. You just have to access your host through it's network IP address (like 192.168.1.10, not 127.0.0.1).

In case you want to use a non-standard HTTP port (like 900), it is possible that you have to manually open that port in the Windows Firewall for your guest to be able to connect to it.

The process is outlined in this answers, but here it is adjusted for your case:

  1. Go to the Control Panel and launch Windows Firewall.

  2. Go to Advanced Settings

  3. Select Inbound Rules in the left pane

  4. Select New Rule in the right pane

  5. In the New Inbound Rule Wizard, select Port as Rule Type, then click on Next

  6. Select TCP and put 900 (and any other ports you want to open) in Specific local ports, then click on Next

  7. Select Allow the connection, then click on Next

  8. Select the network location where the rule should apply (select them all if you're not sure), then click on Next

  9. Give a name and an optional description

share|improve this answer
    
well, my Windows7 Ultimate always had issues with these protocols, I think its a proxy setting that I cannot figure out... basically, 192.168.*.* did not work without first adding it to bindings of IIS, I tried removing memphis from hosts, my machine stops recognizing memphis (yes i know, odd but I never was able to solve this problem). Anyways, my problem wasn't in default 80, it was in 900 port, maybe I should try a different port number? –  Ayyash May 23 '13 at 10:24
    
@Ayyash: Well, true, you would have to add the 192.168.x.x address to your IIS bindings, otherwise you won't be able to use it, I guess. So, if I understand you correctly now, everything is working as intended on port 80, but only port 900 isn't? In that case, did you make sure to open that port in the Windows firewall? –  Oliver Salzburg May 23 '13 at 10:27
    
how do I do that? –  Ayyash May 23 '13 at 10:29
    
@Ayyash: Check this answer: superuser.com/a/92494/36744 –  Oliver Salzburg May 23 '13 at 10:30
    
Oh my God finally! Thanks that worked –  Ayyash May 23 '13 at 10:34
show 1 more comment

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.