Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to route the address from my virtual machine back to my virtual machine through my physical router. How do I configure my virtual machine, host, and router to do so? The host is a 64-bit Vista machine and the VM is a 32-bit Vista machine. Please provide the commands.

Update: The application is a software client that talks to a software server, both on the VM. I need to capture the traffic between the client and server. I have tried and been unable to capture traffic between them using Wireshark, following the instructions here. (There is not a consensus on that page of whether the technique works.) I want to avoid any solution that costs money, if possible.

Update: The VM is Virtual PC.

share|improve this question

Is there any reason you can't create a second VM with the client on one and the server on the other? Or what about creating a simple proxy server off the VM (or maybe use NAT off the device to get the traffic forwarded)? I would expect the OS to recognize when traffic isn't really being sent off the box and skip unnecessary levels of the TCP stack.

share|improve this answer

On the VM itself, just assign to one of your virtual network cards.

Windows automatically adds a routing table entry for your local IP addresses to be routed through the loopback ( interface, so this is already taken care of for you.

If this doesn't take care of your situation, then post a few more details on what you're trying to do.

Edit: With additional details, you should definitely be able to see this in Wireshark. My suspicion is that you're capturing the incorrect network interface with Wireshark. What VM product are you using, and are you seeing other traffic with Wireshark already?

One thing you could do, if the software application allows you, is to set up 2 VM NICs (or 2 IP addresses on one NIC) within your VM. Set the "server" portion to listen on one, and set the "client" to connect up to the server one. Or just set up 2 VMs if it's a true client/server application.

share|improve this answer
I don't think this will work because I need to capture the traffic, which apparently cannot be done even with the Loopback Adapter. – Brian Jul 29 '09 at 19:35
Ahhh. You could possibly adjust the routing table (via "route add" command) but I have my doubts that this would work just to send local traffic to a gateway and back again. Can you edit your post with more details as to what you're trying to accomplish at a higher level? You should be able to capture traffic on a VM though, what are you using? Wireshark? – Brandon Jul 29 '09 at 19:39
You're right; more description was needed. – Brian Jul 29 '09 at 20:10
By the way, are you running Wireshark on your VM host? Or on the VM itself? – Brandon Jul 29 '09 at 20:25

Hyper-V supports multiple virtual hyper-v networks, so what you could do is set up two separate networks, one say at 192.168.1.X and one at 192.168.0.X. Set the gateway on both of these to be the IP of the host server. Then on the host server, set up RRAS to make the host a router (this link might help). That way, traffic will go out of one virtual nic and back in the other.

EDIT: Noticed you specified Virtual PC. With Virtual PC, you could try the route of setting up multiple "Shared Networking" adapters combined with route table entries.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.