Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to redirect all network traffic originating from a specific application running in Windows 7 to a virtual machine guest OS loaded with proxy and network monitoring software. The virtual machine is running Ubuntu as a guest OS within VirtualBox.

How would I go about making the guest virtual machine accessible on my network (or even to my Windows machine), and then redirecting application specific network traffic to be processed by the proxy running on the guest OS?

share|improve this question
    
Yes, it is possible. What is you current network configuration (host, guest and beyond). What have you tried already (route)? Where are you getting stuck. –  Ƭᴇcʜιᴇ007 Nov 2 '12 at 15:56
    
Now I have nothing, but I'm planning to set up Ubuntu with netem configured on virtual machine (VirtualBox on Windows 7 host) to test how my application behaves under non-perfect network conditions. –  mrpyo Nov 2 '12 at 16:45
    
That was a mighty edit @nathan –  random Nov 3 '12 at 3:17
    
But it isn't exactly what I want to do - I mean, doesn't proxy change the sender IP? I don't want that. I want to route (exactly how was it stated in original version of the question) application traffic through virtual machine and not use a proxy. It would be simple if I created another vm for the app and set up previous vm as a router for this vm, but for various reasons I can't do that. –  mrpyo Nov 3 '12 at 7:39
add comment

1 Answer 1

up vote 1 down vote accepted

You can configure your guest OS's Network Adapter in 'Bridged' mode in either VirtualBox or VMware so that the guest will connect directly to your router with a separate MAC address and internal IP address. You can then configure your router to assign a static IP to the guest VM and it will operate as if it were an independent machine on your network. Alternatively you can configure port forwarding through NAT, whereby you would reach the VM at localhost:<forwarded port>. For detailed instructions on how to do this see How to Forward Ports to a Virtual Machine and Use It as a Server on howtogeek.

Once the guest OS is visible to your host OS you can redirect traffic application specific traffic to the VM with Proxifier (trialware). I haven't tested it but I don't think this would alter the originating IP address. You may however need to configure iptables on your guest machine so that it is able to route traffic through netem in your specific use case. You may find Forwarding ports to guests in libvirt / KVM useful reading.

If you wish to route all traffic through the VM see Adding a TCP/IP Route to the Windows Routing Table.

share|improve this answer
add comment

Your Answer

 
discard

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.