Can't ping my Window 7 machine from within a Windows XP virtual machine

17,694

If you do not have DNS or WINS setup to do name resolution, and this is the one computer that you want to be able to ping/resolve by name, a quick fix would be to just add an entry to your hosts file (located in %SystemRoot%\system32\drivers\etc) on the Windows XP VM pointing to the Windows 7 host. It would look like:

192.168.1.5     mywin7hostname

Edit: Okay, based off of your response about IP addresses being assigned via DHCP, you still have a couple of options. The following TechNet article walks through the windows hostname resolution process: http://technet.microsoft.com/en-us/library/bb727005.aspx

When you are trying to ping the Windows 7 hostname, it is not local, you do not have a DNS server which rules out options 2 and 3, you do not have a WINS server which rules out options 4, and 5, which leaves you with NetBIOS broadcasts as the only way for your client to locate the Windows 7 hosts. Go into your Firewall on the Windows 7 box and make sure that you have Network Discovery (NB-Datagram-In) and Network Discovery (NB-Name-In) enabled for the network profile that includes the Windows XP box.

alt text http://i.technet.microsoft.com/Bb727005.chp7hn01(en-us,TechNet.10).gif

Alternately (and probably easier), assign a static IP (or use DHCP address reservation on your router) to the Win7 box in IP range of your network and use the hosts file on the Windows XP VM. Even in a managed corporate network with DNS and WINS, servers tend to be assigned static IP addresses for exactly this reason.

Share:
17,694

Related videos on Youtube

jonathanconway
Author by

jonathanconway

Hello, I'm Jonathan! 👋 Experienced in Front End Development (HTML, CSS, ES6, Angular, React), Back End Development (C#, Java, NodeJS) and Software Engineering (OOP, RDBMS, TDD and beginning to branch into FP). Additionally trained and experienced in Interaction Design (User Research, Sketching, Wireframing, Prototyping, Accessibility). Focused on user needs, with an emphasis on relationships, empathy, evidence and results. I enjoy working in diverse, multi-disciplinary teams, learning and sharing knowledge. Made significant and lasting contributions to several high-impact projects in Australia, for: Bupa (2010), Westpac (2013), Service NSW (2015) and the Digital Transformation Agency (2017). Worked remotely for 5+ clients (including production support and across time-zones), with high self-motivation, productivity and communication (over email, IM and pull-requests). • Continuously programming since 2000 •

Updated on September 17, 2022

Comments

  • jonathanconway
    jonathanconway over 1 year

    I have Windows 7 installed as my primary operating system, on a laptop that's on my home network (wireless).

    I'm using Microsoft Virtual PC 2007 SP1 to run a virtual machine of Windows XP SP3, in which I want to access the Windows 7 instance, both to browse a shared folder and access the local Apache server.

    So far I can ping my Windows 7 IP address (IPv4) and access the apache server through the web browser through HTTP.

    However using my machine name never seems to work. Pinging it fails, and I can't access my apache server using it either.

    The problem seems to be something to do with my machine's name being registered under IPv6 rather than IPv4.

    I'm at a loss what to do. Should I try to set up IPv6 on the virtual machine? Not sure how to go about that. Or maybe I should somehow get my machine name on Windows 7 to work with IPv4?

    Although I think it already does, because I can ping it from a separate box (running Ubuntu), which is only registered under IPv6.

    • Sam Cogan
      Sam Cogan almost 15 years
      Do you have a DNS server?
  • jonathanconway
    jonathanconway almost 15 years
    The problem is, all my machines (virtual and physical) are assigned IP's through DHCP. So this is why I wanted all access to be by DNS name in the first place, because I'm developing web pages that contain certain absolute URL references, and I don't want to have to keep updating them every time I reboot my laptop.