To access Team Foundation Server (TFS) we use a VPN. For a testing scenario I wanted a hyper-v VM to connect to TFS, here’s how I set this up without configuring a VPN inside the VM.
- First make sure the VPN connection is started on the host before you start the hyper-v VM. I’ve read somewhere this was needed and it does work this way.
- Use the virtual switch that is on the same adapter as the VPN. I’m only using the Wifi adapter. Below is a screenshot of the Virtual Switch Manager for the virtual switch I use in the VM’s settings.
- For the proxy I’m using Fiddler. Awesome tool for web debugging, but also a proxy. Install this on the host. (not the VM) Check the option to allow remote computers to connect.
- Now in the VM set the IE proxy. Start Internet Explorer, go to Internet Options > tab Connections and click on LAN settings, there set the proxy to the host machine name and port 8888 (default for fiddler)
Now the traffic from the hyper-v vm will go through the VPN of the host.