Internet Explorer on a Windows virtual machine ignores my hosts file

I am running xp as a virtual machine on windows7 so that I can check which websites look like 6 and 7, which I create locally, on the same machine.

Internet explorer will not find the page hosted on loalhost. "Internet Explorer cannot display the web page." I can put the ip address on another server on my lan, and this works fine, but if it is on the same machine, it refuses.

no proxy.

I turned on and off the idle DNS client service.

can anyone help?

EDIT: my virtual machine file has lines like: 127.0.0.1 mydomain.dev

+7
source share
6 answers

I thank you, ns and Andrew, both of you helped me understand that I do not consider a virtual machine as my own machine. my host file had lines like

127.0.0.1 mydomain.dev

which is perfectly true, but points to a virtual machine (where there is no sw web server). this is my first time using virtual machines and I was so used to my hosts file using 127.0.0.1 for my development sites. I needed to use the ip address of the windows7 machine (where apache works):

192.168.1.42 mydomain.dev

I am sure that one of you would see my mistake if I were not so sure about my hosts file. thank you I hope this helps someone else!

+6
source

If you mean the local host, as on your Windows 7 computer, it looks like you are not using the Bridge network. This means that your virtual machine can go outside, but cannot see your local 192.168. * Subnet.

Do it in your windows 7 command line

ipconfig / all

And this is in your Windows XP

ipconfig / all

You will probably get something similar on your Windows 7 computer

(NIC) 192.168.1.100

Virtual-Box 192.168.10.100

and something like this on your xp windows

(NIC) 192.168.10.101

I suspect that your virtual machine is on a different subnet than your main network adapter.

All hope is not lost, you can

  • Change the virtual machine network bindings to bridged mode

  • or use the IP address that is on the same object on your Windows 7 computer as your Windows xp, and make sure your web server is bound to 0.0.0.0 (all interfaces).

If you are trying to access a web server running on your computer with Windows 7, like 192.168.1.100 from your xp window, you simply change it to 192.168.10.100. Keep in mind that I have compiled all these IP addresses and you will need to change them yourself.

+3
source

try link 1 , I had a similar problem and I did my best to document it. did not find this solution after searching a few minutes.

Basically, you go to your local network settings in Internet Explorer and turn off automatic configuration. Don’t worry, this setting also affects another browser.

+3
source

Windows XP must be rebooted for host file settings that apply to Internet Explorer.

+2
source

At some point, I ran into the same problem.

In IE10 and IE11, protected mode is always enabled by default. Add the URL of trusted sites to the Internet Explorer Settings Security tab. Uncheck "Reset SSL" if the site works only on the http protocol.

Also with Windows 8.1, unchecking the "Automatically detect settings" checkbox in the LAN settings ("Connection" tab) allows you to configure entries in the HOSTS file.

This should fix the problem.

+2
source

a 'quick' way to add host to your hosts file with the host ip address so you can visit http://host:<port>/<path> inside your vm:

  • In the virtual machine, open the administrator console (Win, "cmd", CTRL + SHIFT + ENTER)

  • run "CMD / f: off" (which allows you to insert tab characters)

  • Paste the following into cmd

     reg query "HKEY_CURRENT_USER\Volatile Environment\1" /v CLIENTNAME | more +2 > %TEMP%\clientname.txt & set /P regclientname=<%TEMP%\clientname.txt & call set CLIENTNAME=%regclientname:~28% & call echo %CLIENTNAME% & call nslookup %CLIENTNAME% | more +4 > %TEMP%\addr.txt & SET /P ADDR=<%TEMP%\addr.txt & call set HOSTIP=%ADDR:~10% & call echo %HOSTIP% & set HF=C:\windows\System32\drivers\etc\hosts && echo.>>%HF% && echo.>>%HF% && call echo %HOSTIP% host >>%HF% && type %HF% 

NB: the extra β€œcall” prefixes are that they select previously set variables. It should get CLIENTNAME from the registry, because it is set only as a variable in unselected sessions.


As an alternative!

  • Win
  • http://%CLIENTNAME%/
0
source

All Articles