IIS on Virtual Computer - asp.net

I'm new here. I'm developing some Asp.Net applications and i wanna test them on my virtual IIS. I have installed Windows 7 and enabled IIS features on a VmWare virtual computer. I'm using IIS 7 recommend configuration and my virtual computer have a real internet network IP. I wanna explore my websites via writing my virtual computer's IP to my browser. How can i do that?

First make sure your VMWare machine has a network interface that allows it access to the host. So, in other words: the two machines (host and virtual machine) must be able to "see" each other on the network.
Next, open a Cmd window on the virtual machine and execute ipconfig. That will tell you the IP address of the virtual machine.
Next, ping that IP address. It should work.
If it does, try to access the website on the virtual machine by typing the IP address into a browser on the host machine.

Related

HTTP request from one Virtual machine to another

I have started 2 virtual machines in my computer (using VirtualBox on Windows 8.1) in same time. On first i have Linux Debian with Apache http server. On second running Windows XP. Both networks are set as NAT.
Http request must have specific URL (for example: "xxx.local"). So when I try connect from my real computer to virtual machine with Linux server its easy and its work, there I add only redirect for domain "xxx.local" to virtual machine IP and everything working fine.
But I need send request and receive reply from second virtual machine with Windows XP.
Is there any way to do that?
You can add additional network adapters to both VMs attached to one host-only network.
Ok I got it. There is important to set "host only network adapter" for both virtual machines (but not the same one!) with same IP radius. Then you set IP of server machine to target domain in host file and that is all.
Works fine :-)

Access localhost on the main machine from VMware Workstation 8 for ASP.NET development test

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?
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.
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/

How to forward ip/port [Windows]

I have a guest machine (linux), installed in a virtualBox.
I can access to the guest machine from my host machine (a windows machine), but i can't access to the guest machine from outside.
my guest machine contain a web server (port 8080).
I think I must forward ip/port in my host machine like this:
ip_host/8080 to ip_guest/8080
I want to use just command line in windows or something like IPTables (no use of a software).
Thanks for any suggestion/Ideas
Virtual machine network settings
The easiest way to do what you want is to configure the network interface on your virtual machine to use the bridged network option. There's probably a checkbox for this where you configure the virtual machine in VirtualBox. This will allow connections to and from your virtual machine and the virtual machine will be on the same network as your host machine.
Using netsh
If for some reason you can't do the first then you can use netsh to forward a port from the external interface on your host machine to the interface of your virtual machine. For example see: http://technet.microsoft.com/en-us/library/cc754535(WS.10).aspx#BKMK_95. You need to enter something like 'netsh routing ip nat ....' on the cmdline to enter that context and fiddle with the portmapping setting to get what you want. I doubt it would work on XP
Using a proxy server
If the top 2 don't work try running FreeProxy and setting up a tunnel from your external interface to the interface on the virtual machine. The virtual machine must not be behind a NAT, so again check the network config settings of the virtual machine and make sure it's bridged or host only.

Debug website on host from virtual machine

I have a Windows 7 machine hosting a Windows 7 virtual machine. I am developing a web application using visual studio 2010 on my host machine. I want to run the application in debug mode and access my localhost server from a browser on the virtual machine. (The purpose of this is to be able to debug an application that uses Windows Authentication using different users without having to log off and on for different users on my host machine...)
I am using a bridged connection for the virtual machine. I googled how to solve this problem and most of the threads that I found said that if I was using a bridged connection, I could access the server on the host machine by just entering the IP address of my host machine into the url in the browser of the virtual machine. I have tried some different urls using the IP but none of them have worked.
As an example, suppose I run my web application in visual studio on my host machine and its url is
http://localhost:62789/MyPage.aspx
Assume also that I ran ipconfig in CommandPrompt on my host machine and found out that the IP address for my host machine is xxx.xxx.xxx.x. What url should I enter on the virtual machine to access my web application?
Thanks in advance.
EDIT:
I set up IIS to host the web project. After that, I just added the following line (xxx.xxx.xxx.xxx is my IP) to my hosts file and I was able to access the website from the virtual machine:
xxx.xxx.xxx.xxx MyWebsite.net
I also had to edit my firewall settings.
I personally found it easiest to setup my virtual machine using the Microsoft Loopback Adapter, and assigning the virtual machine to that adapter. The Guest OS will be assigned it's own IP with DHCP. Using the Loopback Adapter will basically put your host and guest OS on the same network. The guest will only be able to access the host, and will not be able to access the internet.
You could then access the host from the guest using whatever ip address you see on the host(run ipconfig/all on the host).
Edit: FYI I am using Virtual PC so your milage may vary. THe Loopback Adapter is a free download from Microsoft.
Edit2: You will probably need to open ports on the host machine to allow access to the web server also. The guest OS's request will still be going through the Windows firewall
It seems like you might be using VisStudio's integrated Web Server. I'm not sure this can accept requests from any host other than localhost.
Remote machines cannot connect to Visual Studio web server
Simple solution? Use IIS to host the project. Once IIS is installed (if not already) it's easy to change the project settings such that a virtual directory is created and debugging occurs in IIS.

adding Virtual PC 2007 to host network

I am using Virtual PC 2007 with Windows xp Pro as the Guest.
Is it possible to add the Virtual PC to the network of the guest PC and to the domain of the Guest PC?
I enabled NAT shared networking but that only allows internet access on the guest..
Thanks
This shouldn't be a problem when you add the guest to host's physical adapter:
In the settings for your VM, go to Networking and instead of "Shared networking (NAT)", select the NIC that's connected to the network on your host (e.g. "Realtek RTL8116 Gigabit Ethernet", or whatever your NIC is; this is equivalent to VMWare's Bridged Mode). That way, the guest will appear as a real computer on your network, and will work like a physical box on the network.
IIRC, MS VPC bypasses the default Windows firewall on the host, so only the guest's firewall applies; for other FW products, you may need to enable something like "permit packets not destined for this host".
Just to add to the above answer-
1.
Inside the Local Area Connection
Properties- VM Network Services Driver
wasnt installed without which the NIC
option wont appear in the Virtual
machine Network Adapter Configuration.
I reinstalled the Virtual PC and that
entry Virtual Machine Network
Driver appeared.
2.
Another helpful resource-
http://blogs.msdn.com/virtual_pc_guy/archive/2007/01/15/fixing-broken-virtual-networking.aspx
Shouldn't be a problem as long as you can connect to a domain controller from the virtual computer.
If you know the IP address of a domain controller, try to ping it. Then try to ping it using the computer name, to see if name resolution is working correctly. What happens when you join a domain using Control Panel | System. Do you receive an error message?
I have not used Virtual PC, only VMWare workstation on Linux, so I do not know how the networking setup is on Virtual PC. On VMWare, you can choose between bridged and NAT networking for a virtual machine. I have been able to set up Windows guest computers as members of a windows domain using both kinds of network setup.

Resources