Parallels/Windows7 & Localhost

Discussion in 'Web Design and Development' started by keithiopian, Mar 26, 2012.

  1. keithiopian macrumors newbie

    Joined:
    Mar 26, 2012
    #1
    Hello,

    I am trying to connect to my localhost using Internet Explorer. On the Mac side of Parallels all is well with my browsers (firefox, chrome, safari, opera). However, once I switch to the Windows side, localhost is no longer recognized.

    Has anyone any insight into this situation for me?

    Thanks for your time!
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    You're accessing 2 different localhost. localhost from a virtual machine is different from that of the host machine. You'll need to enter the IP to connect.
     
  3. Darth.Titan macrumors 68030

    Darth.Titan

    Joined:
    Oct 31, 2007
    Location:
    Austin, TX
    #3
    In addition to using your Mac's IP, you need to make sure that your VM's networking is set to Bridged Ethernet instead of Shared Networking. Otherwise the VM won't be able to find your Mac on the network.
     
  4. MikeTheVike macrumors regular

    Joined:
    Aug 8, 2009
    #4
    Any tutorials out there for how to do this? I use VMWare Fusion and would like to view localhost sites on my Windows VM. Thanks!
     
  5. bpaluzzi macrumors 6502a

    bpaluzzi

    Joined:
    Sep 2, 2010
    Location:
    London
    #5
    You can use localhost, you just need to edit the parallel machine's hosts file

    It's located at: /WINDOWS/system32/drivers/etc/hosts

    Edit it in Notepad, and add the following line, replacing <mac IP address> with your machine's IP address:

    Code:
    <mac IP address> localhost

    Note that this works for any hostname, so you can (for example) test locally-running Apache development environments from the Windows VM
    e.g.:
    Code:
    192.168.1.3 dev.testsite.com
     
  6. MikeTheVike macrumors regular

    Joined:
    Aug 8, 2009
    #6

Share This Page