please help - cannot access IIS from outside a VM RRS feed

  • Question

  • User943880429 posted

    I run Windows 10 inside a VM running via kvm on debian Linux.

    I could fix everything, share the clipboard, mount a shared folder in a shell via cifs-tools. I use the spice-guest-tools that installed a certain number of drivers (network, I/O, etc).

    BuT I am stuck to access an IIS webserver running in development inside the VM.

    I enabled the port 43306 that I need in the windows firewall incoming TCP trafic.

    In the Internect Information Manager, I could change the config for ipSecurity to enable the IP of my host. I added many variants.

    I reached a state for which the host linux can access the server in the VM but it causes a 403 error.

    If I add a binding to the IP of my VM in IIS manager, I then get a 401 error, the same error I get from both inside the VM and outside the VM.

    I also had played with HTTP redirect and I could not removve it properly even though it looks removed. SO I may need to reinstall WIndows but it should be fast. And then I wil reach the error 401 step above. I also played with the anonymous authentication and then it started to show a default IIS page that I could not remove to reac h the old state.

    BUt let us assume I reinstall windows,

    If I am  inside the VM, on windows, the IIS server is run, and it only allows an url of the form localhost:44306. If I put the IP of the VM (the IP of windows not of linux), then I get an error not authorized with a large page. THis happens only in WIndows in a pure WIndows and IIS world. Not really caused by being in a VM.

    I created a binding for the VM IP, it changed the error page but I am still not authorized with the login information I have.

    STuck on that. A binding was not enough, it still blocks the authentication. ALso I have registered the certificate of IIS inside firefox.. ANd somwehre in the IIS manager I think I could pick the righ certificate set up from and towards localhost.

    Friday, May 10, 2019 6:27 PM

All replies

  • User943880429 posted

    TO simplify,

    ONly with IIS on WIndows, in developpment debug run. It requires to have localhost in the URL.

    BUt if int the IIS manager, I create a binding to Windows IP, then I can use:

    Still it will tell me in a page error 401, not authorized.

    SInce I checked everything in IIS manager, it could be a sepcific functionality of windows I need to activate to make it show up in IIS manager.

    OR it could be some config files stuff in the Visual studio project.

    Saturday, May 11, 2019 2:25 PM
  • User690216013 posted

    You gave a lengthy description, but it does not contain enough info (like IIS configuration) for others to comment what might be wrong. So my advice is,

    1. Before doing anything else to confuse yourself, learn about IIS site bindings and see what incoming requests they expect, https://docs.jexusmanager.com/tutorials/binding-diagnostics.html With that knowledge and some on the virtual networking, you should be able to figure out what are the right URLs to use on Linux side to send valid requests to the IIS server on Windows guest.
    2. Then the next task to learn IIS status/sub-status codes https://support.microsoft.com/en-ca/help/943891/the-http-status-code-in-iis-7-0-iis-7-5-and-iis-8-0 The more you learn there, the easier for you to tell what issue you hit and what solutions are showed by Microsoft.
    Sunday, May 12, 2019 2:19 AM
  • User943880429 posted

    OK thank you. I will read mopre. But I feel stuck.

    If you install visual studio and IIS from scratch, then you will only be able to use localhost:44306, not an IP. so it can be seen how to set this up on WIndows only, not to fix a complex setup.

    Sunday, May 12, 2019 6:53 AM
  • User690216013 posted

    you will only be able to use localhost:44306

    If you use Jexus Manager to analyze the IIS Express configuration file generated by Visual Studio, you will see what site binding was created by VS, and why it then enables localhost:44306 URL, and not IP. The more you know of site bindings, you know how to add/change the bindings to accept requests at IP:44306 for example.

    Many blog posts in fact use the same concept, such as mine https://blog.lextudio.com/how-to-let-android-emulator-access-iis-express-f6530a02b1d3 But if you never know how site bindings work, you won't easily know why the setup looks like that.

    Sunday, May 12, 2019 5:36 PM
  • User943880429 posted

    WHy Can I not see any log in the IIS forlder for logs? I only see very empty old logs!

    I am still stuck on this.  Plaese help. I have activated the logs every hour so maybe I will be able to find logs.

    But I have tried another thing than trying to change the IP in the url only on the VM.

    On the host, I have mapped localhost to the ip of the VM. This allows me to skip having to reach the server using a difference domain than localhost which seems to be enrooted in IIS.

    But when on the host (linux), I browse to localhost:44306, I get this error:

    "HTTP Error 403. The request URL is forbidden."

    I could not create a binding for 44306 since it said it already exist and can override an I did not want to risk ahving to reinstall windows again. But I could change to 443 the whole IIS server. ANd I could create a binding for 443 in IIS manager. IN addition the window firewall has a special rule HTTPS on 43 that is active by default which encouraged me to change to 443.

    so now I have the same error as before using from teh host, https.//localhost:443

    Forbidden URL.

    And in ipSecurity, I have allow unlisted, so it should allow any remote IP t o access.

    Wednesday, May 15, 2019 2:37 PM
  • User943880429 posted

    The first time I used IIS, it installed certificates. So I think I need to copy the certificated from windows to my linux machine and install teh certificate in the browser. BUt this is hard for me to understand.

    IIS gave me a doc link the first time it installed certificates:


    see in particular the window with "Read the Security Warning" installing the certificate.

    Before I reisntalled Windows, I think I could reach teh error 401 instead of 403 by installing certificates. Now I only get error 403.

    I also suceeded to acces folders by individual files by enabling somewhere folder access in the IIS manager. So I really suspect teh certificate to be fixed to reach what I already had before.

    I reinstalled windows because the redirect rules could not be removed and were behaving strangely.

    Wednesday, May 15, 2019 3:05 PM
  • User943880429 posted

    No I think the certificate is fine. It just downloads it the first time the server is reached.

    Wednesday, May 15, 2019 3:13 PM
  • User943880429 posted

    I realize now teh default web site in IIS manager is using http and my visual studio iis uses https so maybe they are not in sync at all.

    Wednesday, May 15, 2019 3:22 PM
  • User943880429 posted

    I think something useful I did in the IIS manager is to add a binding on the https port 443. But I cannot do it for my development server since it does not show up in the IIS manager.

    the default web site is pointing to another folder path and is never started.

    So maybe you can clarify this for me.

    I tried to make the default web site point to my visual studio project folder but it did not work.

    Wednesday, May 15, 2019 3:28 PM
  • User943880429 posted

    I could change the path  for the default website to where visual studio builds in a sub fodler /obj/Debug

    now I can start the server from IIS maanger and it works on the VM.

    But it cannot be reached from the host linux.

    BUt now I know the config in IIS manager applies. So I am a little closer to a solution.

    Wednesday, May 15, 2019 3:35 PM
  • User943880429 posted

    after adding several bindings, I get a new error page from the host linux:



    403 - Ej tillåtet: Åtkomst nekas.

    Du har inte behörighet att visa den här katalogen eller sidan med de autentiseringsuppgifter som angetts.

    Wednesday, May 15, 2019 3:48 PM
  • User943880429 posted

    I remove dthe IP binding for the top element in IIS.

    NOw the website can only reach by folder browsing, it does not run the server any more. Very strange. Cant set it back.

    IT should not be needed to reinstall IIS. There must be a way. cant find the doc for this.

    Or maybe my visual studio was running the server and got confused. But that surprizes me. I thought it was started in IIS manager.

    Wednesday, May 15, 2019 4:22 PM
  • User943880429 posted

    I found one answer, but it did not work.


    Wednesday, May 15, 2019 4:57 PM
  • User943880429 posted

    My guess is that IIS manager does not have the libraries and stuff to run my MVC application .NET 4.5.2. In a strange way it does not pick it in a natural way. I activated the windows functionalities.

    Maybe I need to install .NET 4.5.2 separately on Windows. Any advice about this?

    ths installer does not support windows 10.


    does somone know if it is worth installing on WIndows 10 to try?

    foun hre 4.6.2 suports it


    Wednesday, May 15, 2019 5:35 PM
  • User943880429 posted

    I progressed. Now I found I have to use publish in visual studio.

    Now I am stuck on error 500.19, web.config invalid

    but I could validate it using an online validator.

    Thursday, May 16, 2019 6:53 AM
  • User943880429 posted

    here is says i need new windows bundles. very strange


    here the doc


    Thursday, May 16, 2019 7:08 AM
  • User943880429 posted

    I don't understand the doc because there is no public static void Main where I can put the IIS integration commande. I have an MVC app. But I did install the server bundle  thing.

    And I do not have a project.json to add the iis-tools

    Thursday, May 16, 2019 8:38 AM
  • User943880429 posted



    Thursday, May 16, 2019 8:55 AM