Question

I run an ASP.NET Development Server (that came with MS Visual Studio 2010) on my Windows 7 machine. I'm currently developing an ASP.NET C# web application and to test it on Windows 7 machine I need to navigate my web browser to an address like this:

http://localhost:59215/Default.aspx

I also have the VMware Workstation 8 installed on that Windows 7 with other OS as virtual machines. I need to try to load my web app from those virtual machines, but when I type the above address there I get "Cannot display page" error in a browser. Note that I can access internet from a virtual machine itself, but for some reason localhost on the main machine is not accessible.

Any ideas how to set this up?

Was it helpful?

Solution

OK, I got it!

For those who're interested, here's how:

Say, my developement URL on the host computer is: http://localhost:59215/Default.aspx

Download this util, called tcpTrace and run it on a host machine. When it starts configure it as follows:

Listen to port #: 80
Destination Server: localhost
Destination Port #: 59215 (which will be different in your case)

Click OK and let tcpTrace run on the host computer.

On the virtual machine navigate the browser to the IP address of the host computer, for instance in my case: http://192.168.0.4/Default.aspx

and it will work!

PS. To get an IP address on the host machine, run ipconfig there (in a command prompt window). Your IP will be presented in the "IPv4 Address" line for network you're connected on.

PS2. Also my Windows 7 (host) doesn't come with any third-party anti-virus or firewall. It has a built-in Windows firewall and MS Security Essentials as an AVP. So if your setup is different one needs to open the incoming port 80.

PS3. Speaking of the VMWare Workstation, the virtual machine's network adapter setting is set on "NAT: Used to share the host's IP address" as it came out-of-box when you install it.

OTHER TIPS

localhost is the local machine (to the OS).

I'm not sure if the VS dev server will allow external connections, you may want to install IIS - either way, you'll have to open up the Windows Firewall to allow external connections.

I'm no VMWare user but each OS will have its own IP address(?) - and that's how you'd connect to the Windows 7/IIS image. http://the.ip.address.of.the.win7.image/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top