Share via

How can I configure a VPN for virtual machine in Hyper-V

makijemakije 0 Reputation points
2023-02-27T17:11:02.38+00:00

I am running Windows 11 Pro along with TunnelBear VPN and using an Android x86 operating system. However, I am having trouble connecting Android OS to the VPN. When I use the default switch, it shows as connected but without internet access. If I turn off the VPN, everything works normally. I am looking for guidance on how to properly configure the VPN within the virtual machine. If anyone has any suggestions, please let me know. Please help!

Windows for business | Windows Client for IT Pros | Storage high availability | Virtualization and Hyper-V
Windows for business | Windows Client for IT Pros | Networking | Network connectivity and file sharing
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments

1 answer

Sort by: Most helpful
  1. Limitless Technology 45,231 Reputation points
    2023-02-28T13:55:53.0266667+00:00

    Hello

    Thank you for your question and reaching out. I can understand you are having query\issues related to configure a VPN for virtual machine in Hyper-V

    If you need to create a virtual machine with VPN server installed and servicing the "outside world" do the following:

    1. Create virtual network (Hyper-V -> Virtual Network Manager -> Type: External Network, Name: LAN -> Connect to the physical adapter connected to the internal LAN
    2. Create virtual network (Hyper-V -> Virtual Network Manager -> Type: External Network, Name: WAN -> Connect to the physical adapter connected to the internet
    3. Create virtual machine (Hyper-V -> New Virtual Machine -> on the step "Configure Networking" Connection: LAN -> complete the wizard with desired configuration
    4. Edit the virtual machine configuration (Hyper-V -> select VPN virtual machine -> Right-click - Settings... -> Add Hardware -> Network Adapter -> Network: WAN. Write down the network connections' MAC addresses.
    5. Start the virtual machine -> Install OS -> Configure IP Addresses and rename the network connections (for better management and config) by noted MAC addresses-> Install Network Access and Protection Role - Select RRAS -> Start RRAS -> Configure -> Custom -> Select VPN Server, eventually NAT => Configure LAN network as a Private Network and WAN as a Public Network

    Reference thread:

    https://social.technet.microsoft.com/Forums/sqlserver/en-US/f64bae16-2f2c-448a-a879-404ee49c7da9/vpn-installation-in-hyperv?forum=winserverhyperv

    --If the reply is helpful, please Upvote and Accept as answer--

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.