If you’re running a workstation-based product, such as Virtual PC or VMware Workstation (or Server), then you have to be sure that you have selected the correct network adapter type, which is a bridged connection, IIRC. From there, you have to either assign a valid IP for your network, or ensure that your dhcp server knows about the VM’s MAC, if you do reservations.
Previous answer by BlankReg:
Check that the virtual machine doesn’t have a firewall running. This can allow it to ping other machines, but no-one can ping to the virtual machine. (This is also true for ‘real’ machines as well as virtual).