Use VPN from host in hyper-v VM

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.
    hyper-v-network-detail
  • 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.
    fiddler-allow-remote
  • 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)
    ie-proxy

Now the traffic from the hyper-v vm will go through the VPN of the host.

About erictummers

My work as a recruited developer changes almost every month. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Tooling and tagged , , . Bookmark the permalink.

One Response to Use VPN from host in hyper-v VM

  1. ExodusVI says:

    Pretty cool, I’ve been having to manually do this for a long time due to some issues with FreeBSD and legacy Linux. Its a pain in Windows as well but this is definitely somewhat different than what my series of steps were thank you

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s