Access IIS Express running on virtual machine - visual-studio-2010

I'm trying to access IIS Express that I have running on a windows virtual machine on my mac. I have tried including an additional binding pointing to the IP of the virtual machine, ive used netsh to allow a url reservation and made sure that the firewalls are not enabled.
After all of this I attempted to run a program in visual studio and access it via the url on my Mac. The page idles for a large amount of time before returning the error that there was "No Route Host"
This is driving me crazy! Does anyone have any suggestions as to what could be causing it?

Do the following:
Open IIS, and check whether your HTTP website is running on port 80.
Ensure above by first browsing your website on windows guest itself.
Check connectivity by sending ping from your MAC host to windows guest IP.
If above succeeds, perform telnet on port number 80 from MAC host.
You must be able to crack your issue at one of the above points.

Related

Are there any alternatives to hosts file for accessing virtual hosts from multiple PCs?

I have several virtual hosts set up on my PC running WAMP. All the other PCs in the office need to be able to access these too. Traditionally, every time I added a new virtual host to my PC, I need to go to all of the other office PCs and modify their hosts files. This works fine, but it is a pain to go edit all of these files.
Is there an alternative to this? Is there some way of having a centralised hosts file on the network or some other solution?
Some routers have the ability to map domain records into IP adresses and act like a DNS. But if your router dont support this:
Try Acrylic DNS Proxy. Acrylic is a free and open source local DNS proxy. Follow the installation instructions on the website to set it up. Basicly you will need to install this program only on your main PC that will act like a "DNS proxy". Then you will need to set your other computers primary DNS server to hook with your main pc.
Step 1: Install
Launch the Acrylic.exe file and click on the Next button.
Read and (if you like it) accept the license agreement by clicking on the I Agree button.
Choose the installation folder (the default is the Program Files\Acrylic DNS Proxy folder) and click on the Install button.
Step 2: Configure
Do the following steps only on your main PC
Click on Start Menu -> Programs -> Acrylic DNS Proxy -> Config -> Edit Configuration File
Find the text "; ALLOWING REQUESTS FROM OTHER COMPUTERS" and configure it properly. Its well commented and very easy.
Click on Start Menu -> Programs -> Acrylic DNS Proxy -> Config -> Edit Custom Hosts File
Edit the host file as you want. You can use Wildcards like "192.168.0.2 *.local" or regular expressions. So all the domains ending with ".local" will be pointed to your main server.
Note: After changing the configuration files you must restart the Acrylic DNS Proxy service from the start menu.
Step 3: Hook to the DNS Proxy
In order to use Acrylic you have to tell your computer that the DNS servers to be contacted for name resolution is no more your ISP's but Acrylic. There are ways to do it depending on the version of the OS you are running:
Windows 2000
Windows XP or Windows Server 2003
Windows Vista or Windows 7 or Windows Server 2008
Note: On your other computers you will have to replace the "127.0.0.1" to your main PC network address. For example "192.168.0.2" . And leave the secondary DNS to 8.8.8.8 (Google DNS) so the other computers can browse the internet even when your main PC is not connectable (or turned off). Like this
Step 4: Test
Make sure everything is properly configured and your main PC is connectable and running. If you have antivirus or firewall programs they will block this DNS proxy so make sure you configure them properly or disable them at first just to test everything is working. Also your main PC local IP address must be static.

Getting Visual Studio debugging to work when running in Parallels

I've got a Windows 7 machine set up on Paralells.
Everything is working fine. Can access internet from IE or other browsers on my Parallels.
However, when trying to debug a web application in Visual Studio 2010 (by pressing F5 for example) then my default browser in OSX launches, which is great, with localhost:4243 (or whatever port Cassini has allocated on my vm)
Naturally, this doesn't find anything...
What do I need to do to either my parallels vm, or the settings on OSX to get debugging working? ie- my mac talking to the vm?
Make sure you are on the same network.
Use IIS.
Like so:
Your Win-machine has a name, let's say it's called "myWin7machine". Change "localhost:4243" to "myWin7machine:4243" in the browser.
If this doesn't work (well... it shouldn't) you might have the firewall on or the network not bridged. Let's start with the bridging.
Time to check some basics - be on the same network
Check your IP address. It's "ipconfig" on the Win machine and "ifconfig" on the mac; both run from the command prompt. The IP address should be something like 10.4.... or 192.168... on both. The important thing is that only the last number is different. (this is technically not correct but works for 99% of the cases) If they are equal (except the last) you are bridged - which means both machines are on the same network. If they differ too much you had running the Win machine's network "inside" the Mac's. Go to the settings for Parallels (in windows: move your mouse to the top to show Parallel's menu and go to Devices->Network and something "(bridged)". Wait until the balloons disappear and check ipconfig again.
Check that you can ping the Win machine from the Mac. Ping functionality might be turned off in the Win machine but probably isn't.
Now we know we are on the same network.
Still doesn't work
Can you do http://myWin7machine:4243 from the mac? Well.. you shouldn't be able to.
Can you do it from the Win machine? You should.
IIRC Cassini doesn't talk to strangers. I.e. it doesn't talk to anything but localhost.
If I am wrong - just open port 4243 in the firewall on the win machine and you should be good to go.
But otherwise...
Time to change web server.
Install IIS on the win machine.
In the Mac: surf to http://myWin7machine and see the IIS7 logo show.
If you don't you have a firewall issue. Open port 80. Try again.
If you have come this far then you can surf from the Mac to the IIS on the Win machine.
Time to set up your VS solution
Open the IIS admin GUI. Create a new Site. Let's say you call it MyTestSite. (you can always rename it later) Point it to your VS solution's web. Typically the same folder as web.config resides in. On the win machine: try surfing to "http://localhost/MyTestSite". Your site should show up. You might get an Apppool error.
Now try http://myWin7machine/MyTestSite on the Mac. It should work.
ROCK!
Time to set up debugging in VS
For debugging in IIS you have to connect to the process. In Win7 it requires elevated privileges so either you restart VS as admin or you try to connect and VS will do it for you.
The menu in VS is Debug->Attach to process and you choose w3wp.exe.
This is how you debug faster anyway - by connecting. Restarting your web for every debugging session is a waste of time.
To make connecting faster - use ctrl-alt-p and the continue with using the keyboard.
To make connecting even faster use a macro.
There is more info in these 4 articles: http://www.selfelected.com/tag/iis/
Set a breakpoint. Refresh your browser and the breakpoint should be hit.
Time to hack some code
Good luck!
I'm using Windows 10, VS 2015, Parallels 11 on iMac with OS X El Capitan (10.11.5). The following are the steps that worked for me:
On Windows side:
Get the IP (run ipconfig command in command window)
Get the host name (run hostname command in command window)
In control panel look for Windows Firewall -> Advanced Settings and add a new inbound rule and a new outbound rule. For both make sure you select Port, Allow Connection, TCP and specific IPs. I added a range of IPs 45000 - 45999 but you can select the range you like.
In Visual Studio:
Look for project properties and under web section change Server settings to look something like this.
Instead of "winmac" you will use the host name found in "Windows Side - Step 2". The port can be any number inside the range you setup for your firewall rules.
On Mac OS side:
Update /etc/hosts file. At the end of the file add the IP and host name that we found on steps 1 and 2 of the "Windows side" section. When you finish this step the file should like something similar to this.
Ready to debug:
Now you can start debugging in your Mac from Visual Studio. Make sure that before start the debugging process you select "Open In Mac" option (instead of Chrome or IE in your debugging options in visual studio).

Remote debugging error unable to connect and the remote computer is not responding?

I have been messing with remote debugging so finally out of despair here I am. I am trying to connect to a Win 2003 remote machine where I have remote debugging installed (NO VS installed on this machine.) following this tutorial. So, I have added all the ports to exceptions in the firewall and I am trying to connect from my visual studio 2010 (run as administrator) and windows 7 Home Premium local machine using No authentication method by attaching it to a process. (For some reason I cannot use windows authentication and gives me edition not supported error!)
What happens is on the debug monitor it says that User has connected but then it just sits there waiting and finally gives an error Unable to connect to xxx.xxx.xxx.xxx. The remote machine is not responding. I tried to research a lot and also created a user with the same name as on the local machine on the remote machine. Also I used telnet as mentioned in the link and it does not show connected to the remote system message but does not show that it failed either and just sits there. I am guessing it something to do with the port not open correctly.Also after the first connection attempt when I try to connect again the remote debug monitor does not show any connected message and also the error I get is that remote debug monitor is not setup or running on the machine (almost like the debugger stops reponding). I am pretty exhausted trying out all the options can anyone give me more direction here ? Thanks !

VS 2010 Remote debugging not working

Hey everyone, I'm having trouble configuring my remote debugging set up. I've been searching and reading for a while, but I can't figure it out. I'm running windows 7 as the pc I'm running VS on and then have windows 7 running in virtual box as the pc that is running the program I'm trying to debug. I'm trying to debug a .NET 4 project.
Both computers are not part of a domain (I'm not sure if that matters). I'm running the debug monitor on the virtual pc via a shared folder on the non-virtual pc.
When I try to connect to the remote pc in the attach to process window in VS it connects, but fails to launch, and I get an error that says
Error while trying to run project: Unable to start debugging.
The specified network name is no longer available.
Let me know if I need to say anything else about my set-up.
Thanks for the help!
I finally figured out my problem(s).
I was using the wrong PC name to connect to the host machine. I was using the Server name that you can type in the VS remote debugging monitor. I had it working when I did the server as 'Stephen#192.168...' where that was the actual ip address on my subnet
Windows didn't properly configure the firewall ports for me. I had to manually open the DCOM ports to get it connecting.
I had to clear the existing credentials for each machine once everything else was set up as is shown here http://msdn.microsoft.com/en-us/library/2dbesfyx.aspx
Thanks everyone for your help and pointers.

Running OSX MAMP test server on VirtualBox Windows 7

I have MAMP server and several test sites installed on my OSX 10.6.3. I just installed Windows 7 on a VirtualBox virtual machine. I have managed to successfully share folders to the Windows installation, but I am wondering if I can run my MAMP sites in Windows without installing a different Localhost there.
Does anyone know if this is possible? It would be very convenient if I could test my sites in both operating systems all hosted from a single location.
Although this is probably too late for the OP, posting here for others.
If you're just trying to access your Mac localhost, then all you need to type into
the guest os is 10.0.2.2.
If you're trying to access named virtual hosts such as 0.dev or dev.local, then you need to modify the guest os host file to map the domain names to the host os.
In the case of Windows 7, you simply navigate to C:\Windows\System32\drivers\etc then modify the hosts file with admin privs.
Inside you will you will see the following line commented out
# 127.0.0.1 localhost
Below it, add entries for each of the virtual hosts you wish to use
10.0.2.2 maclocalhost
10.0.2.2 0.dev
10.0.2.2 dev.local
I just setup three VirtualBox VMs today specifically for connecting to MAMP on an OS X host. Thought I’d share my method of doing this since it works well for me.
While accessing the localhost via 10.0.2.2 I find using a host only network to be a much more flexible & reliable way to handle scenarios. You get a another IP address so debugging network issues on a VM can work as well.
First, go to VirtualBox -> Preferences…. Then choose Host-only Networks. You should have a vboxnet0 adapter in place. If not, add one.
Once you are set with that, select the vboxnet0 adapter & click the small yellow screwdriver icon on the right side of that window to edit the options. Under the Adapter pane, set the IPv4 address to 192.168.56.1 & the network mask to 255.255.255.0. Leave the IPv6 area blank. The IPv6 network mask length should be 0.
The DHCP server stuff should be blank, like so.
Okay? Got that set. Now choose your VM. In my example it’s the IE8 - Win7 image for web development testing. And click the Settings gear. Then click the Network icon. And now choose Adapter 2. And choose Host-only Adapter from the pull down menu for Attached to:. And then choose vboxnet0 under Name:. The rest of the options should just be the standard options.
Now, when you startup your Windows VM, launch Internet Explorer. And go to the address:
http://192.168.56.1
With that, you should be set! But if you are used to using Macs, be 100% sure you have the http:// in front of the address. I got embarrassingly stuck when I just entered the straight 192.168.56.1.
And as Jon Jaques says in his answer you can edit the hosts file in Windows to point to the IP address of 192.168.56.1. It will make your life easier & if you know how to setup named virtual hosts in MAMP (not hard) you can setup a few different sites to test via VirtualBox.
Oh, also, if you are used to using your machine name in OS X to connect to MAMP—like with the name LogicArtist.local if that is your machine’s name—you are not in any luck. The VirtualBox built in software router claims to pass multicast data, but it doesn’t. Check out this post which explains it in more detail.
In the environment created by VirtualBox there are multiple NICs that
claim to be multicast capable. However, they are lying. Furthermore,
because of the way VirtualBox assigns metrics, your outgoing socket
will get assigned to a liar who will happily gobble up your multicast
messages and not send them on.
Annoying, but you can work around stuff like that by at least editing your hosts file to have an entry for LogicArtist.local like this:
192.168.56.1 LogicArtist.local
Definitely not as elegant as a true multicast address being passed, but at least the brief amount of time you will be spending in Windows to debug things will be made easier but adding that entry.
MAMP Pro lets you specify the port for each host. Choose a unique port for your desired host. In your virtual machine simply type http://10.0.2.2:PORTNUMBER and your site will appear. Example: I created a host called localuproar and assigned it port number 9000. In VirtualBox I opened up Internet Explorer and typed http://10.0.2.2:9000, and my site appeared.
You can mess around with hosts files as described in previous posts, but I think it is easier to simply type in a port number.
On a related note, there is a very easy way to create virtual machines for all versions of Internet Explorer (http://osxdaily.com/2011/09/04/internet-explorer-for-mac-ie7-ie8-ie-9-free/):
Launch Terminal
Type this in your terminal window
curl -s https://raw.githubusercontent.com/xdissent/ievms/master/ievms.sh | bash

Resources